From 7535dc21abcdc90c9ff54fe6b9280a659ad4604f Mon Sep 17 00:00:00 2001 From: xudan Date: Thu, 31 Aug 2017 02:20:25 -0400 Subject: Bugfix: the config files in useeconfig will cover user's config 1. Now there are 2 sample files tempest_conf.yaml and hosts.yaml in userconfig, and thet will cover user's tempest_conf.yaml and hosts.yaml in $DOVETAIL_HOME/pre_config. 2. Rename the files in userconfig to be tempest_conf.yaml.sample and hosts.yaml.sample. 3. Add the hosts info in file /etc/hosts in Dovetail Container. JIRA: DOVETAIL-492 Change-Id: I2b5694a8058b864b510925eec595d6f2bd1062ff Signed-off-by: xudan --- dovetail/utils/dovetail_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dovetail/utils') diff --git a/dovetail/utils/dovetail_utils.py b/dovetail/utils/dovetail_utils.py index 2c7ac317..23285e3c 100644 --- a/dovetail/utils/dovetail_utils.py +++ b/dovetail/utils/dovetail_utils.py @@ -208,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)) -- cgit 1.2.3-korg