From 1b5b30a15c0993cb7e59841059b53dae411c0b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Tue, 26 May 2015 17:32:57 +0200 Subject: [PATCH] avocado.core.tree: Normalize filter entries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Lukáš Doktor --- avocado/core/tree.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/avocado/core/tree.py b/avocado/core/tree.py index c18c579c..2179cbe8 100644 --- a/avocado/core/tree.py +++ b/avocado/core/tree.py @@ -533,8 +533,12 @@ def apply_filters(tree, filter_only=None, filter_out=None): """ if filter_only is None: filter_only = [] + else: + filter_only = [_.rstrip('/') for _ in filter_only if _] if filter_out is None: filter_out = [] + else: + filter_out = [_.rstrip('/') for _ in filter_out if _] for node in tree.iter_children_preorder(): keep_node = True for path in filter_only: -- GitLab