From 4c1c1361b1d3167c167dfdec7431cc39ed442db6 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 13 May 2016 11:01:52 +0200 Subject: Catch TypeError exceptions in ci/tier_handler.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If INSTALLER_TYPE is unset, is_compatible returns False instead of raising an ErrorType exception. Change-Id: I55c219808851907a19e2aa0124eb13d53a5e685d Signed-off-by: Cédric Ollivier --- ci/tier_handler.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ci') diff --git a/ci/tier_handler.py b/ci/tier_handler.py index dd0d10c9..2fc7a9c4 100644 --- a/ci/tier_handler.py +++ b/ci/tier_handler.py @@ -108,14 +108,14 @@ class TestCase: self.description = description def is_compatible(self, ci_installer, ci_scenario): - if re.search(self.dependency.get_installer(), ci_installer) is None: + try: + return not (re.search(self.dependency.get_installer(), + ci_installer) is None or + re.search(self.dependency.get_scenario(), + ci_scenario) is None) + except TypeError: return False - if re.search(self.dependency.get_scenario(), ci_scenario) is None: - return False - - return True - def get_name(self): return self.name -- cgit 1.2.3-korg