提交 1b5b30a1 编写于 作者: L Lukáš Doktor

avocado.core.tree: Normalize filter entries

There is a great difference between filter path ending with slash or
without it. It might be a source of confusion so this patch normalize
the filter path to match the tree names (without the ending slash).

    --filter-only /path1 /path2/  => /path1,/path2
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 4ae0bf62
...@@ -533,8 +533,12 @@ def apply_filters(tree, filter_only=None, filter_out=None): ...@@ -533,8 +533,12 @@ def apply_filters(tree, filter_only=None, filter_out=None):
""" """
if filter_only is None: if filter_only is None:
filter_only = [] filter_only = []
else:
filter_only = [_.rstrip('/') for _ in filter_only if _]
if filter_out is None: if filter_out is None:
filter_out = [] filter_out = []
else:
filter_out = [_.rstrip('/') for _ in filter_out if _]
for node in tree.iter_children_preorder(): for node in tree.iter_children_preorder():
keep_node = True keep_node = True
for path in filter_only: for path in filter_only:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册