未验证 提交 9990a209 编写于 作者: R Rudá Moura

avocado.core.tree: Match whole key in filters.

When filtering nodes, use the whole key for comparing.

So if you have /long and /longest and you're filtering for /long,
then it will match /long alone.

The previous behaviour was using the partial
string match, so both /long and /longest were being returned,
which is wrong.
Signed-off-by: NRudá Moura <rmoura@redhat.com>
上级 389c860d
......@@ -275,16 +275,16 @@ def apply_filters(tree, filter_only=[], filter_out=[]):
for path in filter_only:
if path == '':
continue
if node.path.startswith(path):
if node.path == path:
keep_node = True
break
if node.parent and node.parent.path.startswith(path_parent(path)):
if node.parent and node.parent.path == path_parent(path):
keep_node = False
continue
for path in filter_out:
if path == '':
continue
if node.path.startswith(path):
if node.path == path:
keep_node = False
break
if not keep_node:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册