summaryrefslogtreecommitdiffstats
path: root/dovetail/utils
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2017-08-16 03:05:56 -0400
committerxudan <xudan16@huawei.com>2017-08-16 03:05:56 -0400
commit433127537222120963133546bc7cde6bd2786858 (patch)
tree2188bab96dd87d3b104d1d61a387a5556fd33086 /dovetail/utils
parent5e261c5ac601ba48bdf358de184337a1be954ff4 (diff)
Bugfix: wrong command in function 'check_https_enabled'
JIRA: DOVETAIL-482 1. In function check_https_enabled, it will use cmd "openstack catalog show identity |awk '/public/ {print $4}'" to check if it is https. 2. However, this command will not work if it is https. 3. Check https via OS_AUTH_URL rather than "openstack catalog show identity". Change-Id: If40ffa8e9b33c38123ff4b834198a8eaaedc1c9c Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail/utils')
-rw-r--r--dovetail/utils/dovetail_utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/dovetail/utils/dovetail_utils.py b/dovetail/utils/dovetail_utils.py
index f74da3a2..2c7ac317 100644
--- a/dovetail/utils/dovetail_utils.py
+++ b/dovetail/utils/dovetail_utils.py
@@ -120,10 +120,11 @@ 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}'")
- ret, msg = exec_cmd(cmd, logger)
- if ret == 0 and "https://" in msg:
+ os_auth_url = os.getenv('OS_AUTH_URL')
+ if os_auth_url.startswith('https'):
+ logger.debug("https is enabled")
return True
+ logger.debug("https is not enabled")
return False