From f4e7709897c748b771751a92964f78e168b77bf4 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 25 May 2016 10:19:12 +0200 Subject: Allow unknown ci_installer or ci_scenario in is_compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ci_installer and ci_scenario are only tested if they are set. At least one of theses variables must be set to get dependencies It modifies the previous logic introduced by the first implementation of tier_handler.py [1] [1] https://gerrit.opnfv.org/gerrit/#/c/12579/ Change-Id: Icc9663a620f0b18f502b3eff7c0ce0d71e4e5910 Signed-off-by: Cédric Ollivier --- ci/tier_handler.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'ci/tier_handler.py') diff --git a/ci/tier_handler.py b/ci/tier_handler.py index 03db4a91d..b1ef52d8f 100644 --- a/ci/tier_handler.py +++ b/ci/tier_handler.py @@ -109,10 +109,15 @@ class TestCase: def is_compatible(self, ci_installer, ci_scenario): try: - return not (re.search(self.dependency.get_installer(), - ci_installer) is None or - re.search(self.dependency.get_scenario(), - ci_scenario) is None) + if ci_installer is not None: + if re.search(self.dependency.get_installer(), + ci_installer) is None: + return False + if ci_scenario is not None: + if re.search(self.dependency.get_scenario(), + ci_scenario) is None: + return False + return not (ci_scenario is None and ci_installer is None) except TypeError: return False -- cgit 1.2.3-korg