Modify logs 85/41285/1
authorxudan <xudan16@huawei.com>
Thu, 7 Sep 2017 08:49:50 +0000 (04:49 -0400)
committerxudan <xudan16@huawei.com>
Thu, 7 Sep 2017 08:49:50 +0000 (04:49 -0400)
JIRA: DOVETAIL-498

Change-Id: Ie98fc89cc840b557aa4186c6c2bee2d610432af0
Signed-off-by: xudan <xudan16@huawei.com>
dovetail/container.py
dovetail/utils/dovetail_utils.py

index cf8e14e..1404516 100644 (file)
@@ -164,7 +164,7 @@ class Container(object):
                     dt_utils.add_hosts_info(host)
                     hosts_config += " --add-host "
                     hosts_config += str(host)
-                cls.logger.info('Get hosts info {}.'.format(hosts_config))
+                cls.logger.debug('Get hosts info {}.'.format(host))
         except Exception:
             cls.logger.warn('Failed to get hosts info in {}, '
                             'maybe some issues with domain name resolution.'
@@ -192,18 +192,18 @@ class Container(object):
             cls.logger.info("https enabled...")
             if cacert is not None:
                 if not os.path.isfile(cacert):
-                    cls.logger.error("Env variable 'OS_CACERT' is set to {}"
+                    cls.logger.error("Env variable 'OS_CACERT' is set to {} "
                                      "but the file does not exist."
                                      .format(cacert))
                     return None
                 elif not dovetail_config['config_dir'] in cacert:
-                    cls.logger.error("Credential file has to be put in {},"
+                    cls.logger.error("Credential file has to be put in {}, "
                                      "which can be mount into container."
                                      .format(dovetail_config['config_dir']))
                     return None
                 cacert_volume = ' -v %s:%s ' % (cacert, cacert)
             else:
-                cls.logger.warn("https enabled, OS_CACERT not set, insecure"
+                cls.logger.warn("https enabled, OS_CACERT not set, insecure "
                                 "connection used or OS_CACERT missed")
 
         result_volume = ' -v %s:%s ' % (dovetail_config['result_dir'],
index 23285e3..fc007e5 100644 (file)
@@ -134,12 +134,13 @@ def get_ext_net_name(env_file, logger=None):
     insecure = os.getenv('OS_INSECURE',)
     if https_enabled:
         logger.info("https enabled...")
-        if insecure.lower() == "true":
-            insecure_option = ' --insecure '
-        else:
-            logger.warn("Env variable OS_INSECURE is {}, if https + no "
-                        "credential used, should be set as True."
-                        .format(insecure))
+        if insecure:
+            if insecure.lower() == "true":
+                insecure_option = ' --insecure '
+            else:
+                logger.warn("Env variable OS_INSECURE is {}, if https + no "
+                            "credential used, should be set as True."
+                            .format(insecure))
 
     cmd_check = "openstack %s network list" % insecure_option
     ret, msg = exec_cmd(cmd_check, logger)