Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
533ecd75
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
533ecd75
编写于
8月 03, 2018
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'ldoktor/cit-mux-path'
Signed-off-by:
N
Cleber Rosa
<
crosa@redhat.com
>
上级
4006f234
a8aa5273
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
25 deletion
+8
-25
optional_plugins/varianter_cit/avocado_varianter_cit/__init__.py
...l_plugins/varianter_cit/avocado_varianter_cit/__init__.py
+8
-25
未找到文件。
optional_plugins/varianter_cit/avocado_varianter_cit/__init__.py
浏览文件 @
533ecd75
...
...
@@ -23,6 +23,7 @@ from six.moves import configparser
from
six.moves
import
zip
from
avocado.core
import
exit_codes
from
avocado.core
import
varianter
from
avocado.core.output
import
LOG_UI
from
avocado.core.plugin_interfaces
import
CLI
from
avocado.core.plugin_interfaces
import
Varianter
...
...
@@ -47,10 +48,6 @@ class VarianterCitCLI(CLI):
cit
=
subparser
.
add_argument_group
(
'CIT varianter options'
)
cit
.
add_argument
(
'--cit-parameter-file'
,
metavar
=
'PATH'
,
help
=
"Paths to a parameter file"
)
cit
.
add_argument
(
'--cit-parameter-path'
,
metavar
=
'PATH'
,
default
=
'/run'
,
help
=
(
'Default path for parameters generated '
'on the CIT variants'
))
cit
.
add_argument
(
'--cit-order-of-combinations'
,
metavar
=
'ORDER'
,
type
=
int
,
default
=
2
,
help
=
(
"Order of combinations. Defaults to "
...
...
@@ -83,7 +80,6 @@ class VarianterCit(Varianter):
"is not readable"
,
cit_parameter_file
)
self
.
error_exit
(
args
)
self
.
parameter_path
=
getattr
(
args
,
"cit_parameter_path"
)
config
=
configparser
.
ConfigParser
()
try
:
config
.
read
(
cit_parameter_file
)
...
...
@@ -116,7 +112,7 @@ class VarianterCit(Varianter):
for
vid
,
variant
in
zip
(
variant_ids
,
self
.
variants
):
yield
{
"variant_id"
:
vid
,
"variant"
:
TreeNode
(
''
,
variant
),
"paths"
:
self
.
parameter_path
}
"paths"
:
[
'/'
]
}
def
__len__
(
self
):
return
sum
(
1
for
_
in
self
.
variants
)
if
self
.
variants
else
0
...
...
@@ -138,27 +134,14 @@ class VarianterCit(Varianter):
"""
if
not
self
.
variants
:
return
""
out
=
[]
verbose
=
variants
>
1
out
.
append
(
"CIT Variants (%i):"
%
len
(
self
))
for
variant
in
self
:
out
.
append
(
'%sVariant %s: %s'
%
(
'
\n
'
if
verbose
else
''
,
variant
[
"variant_id"
],
self
.
parameter_path
))
if
not
verbose
:
continue
env
=
set
()
for
node
in
variant
[
"variant"
]:
for
key
,
value
in
iteritems
(
node
.
environment
):
origin
=
node
.
environment
.
origin
[
key
].
path
env
.
add
((
"%s:%s"
%
(
origin
,
key
),
str
(
value
)))
if
not
env
:
return
out
fmt
=
' %%-%ds => %%s'
%
max
([
len
(
_
[
0
])
for
_
in
env
])
for
record
in
sorted
(
env
):
out
.
append
(
fmt
%
record
)
if
variants
:
# variants == 0 means disable, but in plugin it's brief
out
.
append
(
"CIT Variants (%s):"
%
len
(
self
))
for
variant
in
self
:
out
.
extend
(
varianter
.
variant_to_str
(
variant
,
variants
-
1
,
kwargs
,
False
))
return
"
\n
"
.
join
(
out
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录