Delete the ERROR log when it is not https 49/37449/2
authorxudan <xudan16@huawei.com>
Fri, 14 Jul 2017 02:03:27 +0000 (22:03 -0400)
committerxudan <xudan16@huawei.com>
Mon, 17 Jul 2017 09:31:31 +0000 (05:31 -0400)
JIRA: DOVETAIL-462

1. If it is not https, Dovetail will give a error log
   2017-07-13 21:58:30,409 - container.Container - ERROR - The command
   'openstack catalog show identity |awk '/public/ {print $4}'| grep 'https'' failed.
2. Remove this error log becuase it is not an error.

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

index 2108cdc..2d9701b 100644 (file)
@@ -177,7 +177,7 @@ class Container(object):
         cacert_volume = ""
         https_enabled = dt_utils.check_https_enabled(cls.logger)
         cacert = os.getenv('OS_CACERT',)
-        if https_enabled == 0:
+        if https_enabled:
             cls.logger.info("https enabled...")
             if cacert is not None:
                 if not os.path.isfile(cacert):
index 8112d28..f74da3a 100644 (file)
@@ -120,17 +120,18 @@ def source_env(env_file):
 
 def check_https_enabled(logger=None):
     logger.debug("Checking if https enabled or not...")
-    cmd = "openstack catalog show identity |awk '/public/ {print $4}'| \
-        grep 'https'"
+    cmd = ("openstack catalog show identity |awk '/public/ {print $4}'")
     ret, msg = exec_cmd(cmd, logger)
-    return ret
+    if ret == 0 and "https://" in msg:
+        return True
+    return False
 
 
 def get_ext_net_name(env_file, logger=None):
     https_enabled = check_https_enabled(logger)
     insecure_option = ''
     insecure = os.getenv('OS_INSECURE',)
-    if https_enabled == 0:
+    if https_enabled:
         logger.info("https enabled...")
         if insecure.lower() == "true":
             insecure_option = ' --insecure '