dovetail tool: change CI_DEBUG to DEBUG 11/24011/3
authorzshi <zshi@redhat.com>
Mon, 28 Nov 2016 03:00:35 +0000 (11:00 +0800)
committerzshi <zshi@redhat.com>
Mon, 28 Nov 2016 03:00:35 +0000 (11:00 +0800)
JIRA: DOVETAIL-42

1) change 'CI_DEBUG' to 'DEBUG' in cmd_config.yml
   and dovetail_logger.py
2) assign 'DEBUG' env value to 'CI_DEBUG' when
   updating functest and yardstick parameter 'envs'

Change-Id: I6d6130e394fddf11d83be619f2c9684bf8c859f9
Signed-off-by: zshi <zshi@redhat.com>
dovetail/conf/cmd_config.yml
dovetail/conf/dovetail_config.py
dovetail/utils/dovetail_logger.py

index c2108c5..2d51f88 100644 (file)
@@ -31,11 +31,11 @@ cli:
           - '--DEPLOY_TYPE'
           - '-T'
         help: 'DEPLOY_TYPE of the system under test (SUT).'
-      CI_DEBUG:
+      DEBUG:
         flags:
-          - '--CI_DEBUG'
+          - '--DEBUG'
           - '-d'
-        help: 'CI_DEBUG for showing debug log.'
+        help: 'DEBUG for showing debug log.'
     non-envs:
       scenario:
         flags:
index 5ac23c4..597c5e7 100644 (file)
@@ -52,6 +52,8 @@ class DovetailConfig:
 
     @classmethod
     def update_config_envs(cls, script_type, key):
+        if key == 'DEBUG':
+            os.environ['CI_DEBUG'] = os.environ[key]
         envs = cls.dovetail_config[script_type]['envs']
         old_value = re.findall(r'\s+%s=(.*?)(\s+|$)' % key, envs)
         if old_value == []:
index 6a2d38d..e725e61 100644 (file)
@@ -40,7 +40,7 @@ clean_results_dir()
 class Logger:
     def __init__(self, logger_name):
 
-        CI_DEBUG = os.getenv('CI_DEBUG')
+        DEBUG = os.getenv('DEBUG')
 
         self.logger = logging.getLogger(logger_name)
         self.logger.propagate = 0
@@ -50,7 +50,7 @@ class Logger:
         formatter = logging.Formatter('%(asctime)s - %(name)s - '
                                       '%(levelname)s - %(message)s')
         ch.setFormatter(formatter)
-        if CI_DEBUG is not None and CI_DEBUG.lower() == "true":
+        if DEBUG is not None and DEBUG.lower() == "true":
             ch.setLevel(logging.DEBUG)
         else:
             ch.setLevel(logging.INFO)