diff options
Diffstat (limited to 'dovetail/utils/dovetail_utils.py')
-rw-r--r-- | dovetail/utils/dovetail_utils.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/dovetail/utils/dovetail_utils.py b/dovetail/utils/dovetail_utils.py index f74da3a2..23285e3c 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 @@ -207,3 +208,9 @@ def check_docker_version(logger=None): if client_ret != 0 or (LooseVersion(client_ver) < LooseVersion('1.12.3')): logger.error("Don't support this Docker client version. " "Docker client should be updated to at least 1.12.3.") + + +def add_hosts_info(hosts_info): + hosts_file = '/etc/hosts' + with open(hosts_file, 'a') as f: + f.write("{}\n".format(hosts_info)) |