Fix option handling in case of no '--tag' option. 45/24345/1
authorTomofumi Hayashi <tohayash@redhat.com>
Tue, 15 Nov 2016 09:26:29 +0000 (18:26 +0900)
committerTomofumi Hayashi <tohayash@redhat.com>
Tue, 15 Nov 2016 09:26:29 +0000 (18:26 +0900)
In case of default, 'None' is in kwargs['tag'] so need to
check it in option handling. The code is to fix it.

Change-Id: Iaadf7e6f0f064dda819970346a810a6a8b47c74c
Signed-off-by: Tomofumi Hayashi <tohayash@redhat.com>
dovetail/run.py

index b4b9dda..0ebae73 100755 (executable)
@@ -87,7 +87,7 @@ def run_test(scenario):
 def validate_options(input_dict):
     # for 'tag' option
     for key, value in input_dict.items():
-        if key == 'tag':
+        if key == 'tag' and value is not None:
             for tag in value.split(','):
                 if len(tag.split(':')) != 2:
                     logger.error('TAGS option must be "<image>:<tag>,..."')
@@ -117,7 +117,7 @@ def main(*args, **kwargs):
                 dovetail_config['yardstick']['envs'])
     load_testcase()
     scenario_yaml = load_scenario(kwargs['scenario'])
-    if 'tag' in kwargs:
+    if 'tag' in kwargs and kwargs['tag'] is not None:
         set_container_tags(kwargs['tag'])
     run_test(scenario_yaml)
     Report.generate(scenario_yaml)