From: Cédric Ollivier Date: Wed, 25 May 2016 08:19:12 +0000 (+0200) Subject: Allow unknown ci_installer or ci_scenario in is_compatible X-Git-Tag: 0.2~1528 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=f4e7709897c748b771751a92964f78e168b77bf4;p=functest-xtesting.git Allow unknown ci_installer or ci_scenario in is_compatible 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 --- diff --git a/ci/tier_handler.py b/ci/tier_handler.py index 03db4a91..b1ef52d8 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