Prevent KeyError during main args parsing 79/40079/1
authorMartin Kulhavy <martin.kulhavy@nokia.com>
Thu, 24 Aug 2017 10:26:13 +0000 (13:26 +0300)
committerMartin Kulhavy <martin.kulhavy@nokia.com>
Thu, 24 Aug 2017 10:26:13 +0000 (13:26 +0300)
Change-Id: Ia340c79c82b891e921379c7c0186eaa238117b13
Signed-off-by: Martin Kulhavy <martin.kulhavy@nokia.com>
functest/ci/run_tests.py

index 63a50de..87e3d37 100644 (file)
@@ -188,12 +188,12 @@ class Runner(object):
             self.run_tier(tier)
 
     def main(self, **kwargs):
-        if kwargs['noclean']:
+        if 'noclean' in kwargs:
             self.clean_flag = False
-        if kwargs['report']:
+        if 'report' in kwargs:
             self.report_flag = True
         try:
-            if kwargs['test']:
+            if 'test' in kwargs:
                 self.source_rc_file()
                 logger.debug("Test args: %s", kwargs['test'])
                 if self._tiers.get_tier(kwargs['test']):