From 2ffb0058ab2997f0a62046b2fc194661e363dd90 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 6 Oct 2016 10:50:00 -0600 Subject: [PATCH] suite: parse filter args into lists sooner Signed-off-by: Zack Cerza --- teuthology/suite/__init__.py | 2 ++ teuthology/suite/run.py | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/teuthology/suite/__init__.py b/teuthology/suite/__init__.py index 9bd0a09737..d3be09a185 100644 --- a/teuthology/suite/__init__.py +++ b/teuthology/suite/__init__.py @@ -40,6 +40,8 @@ def process_args(args): elif key == 'subset' and value is not None: # take input string '2/3' and turn into (2, 3) value = tuple(map(int, value.split('/'))) + elif key in ('filter_in', 'filter_out'): + value = [x.strip() for x in value.split(',')] conf[key] = value return conf diff --git a/teuthology/suite/run.py b/teuthology/suite/run.py index 6320c5bd15..0763cab712 100644 --- a/teuthology/suite/run.py +++ b/teuthology/suite/run.py @@ -293,10 +293,9 @@ class Run(object): # separated components to be used in searches. filter_in = self.args.filter_in if filter_in: - filter_list = [x.strip() for x in filter_in.split(',')] - if not any([x in description for x in filter_list]): + if not any([x in description for x in filter_in]): all_filt = [] - for filt_samp in filter_list: + for filt_samp in filter_in: all_filt.extend( [x.find(filt_samp) < 0 for x in base_frag_paths] ) @@ -304,11 +303,10 @@ class Run(object): continue filter_out = self.args.filter_out if filter_out: - filter_list = [x.strip() for x in filter_out.split(',')] - if any([x in description for x in filter_list]): + if any([x in description for x in filter_out]): continue all_filt_val = False - for filt_samp in filter_list: + for filt_samp in filter_out: flist = [filt_samp in x for x in base_frag_paths] if any(flist): all_filt_val = True -- 2.39.5