diff options
author | wu.zhihui <wu.zhihui1@zte.com.cn> | 2016-08-24 21:09:02 +0800 |
---|---|---|
committer | wu.zhihui <wu.zhihui1@zte.com.cn> | 2016-08-25 12:47:52 +0800 |
commit | 7898ea8560477046a0d770d94f0f0f2c8f3f3084 (patch) | |
tree | d3884dfc3cb36aa29bd3e1c54c1d0a04bde5ad69 /func/env_setup.py | |
parent | a1a518a774a3a4e0332eb1f1644d97a5a29382e4 (diff) |
Bugfix: some errors in env_setup.py.
Change-Id: Ia9ab50f8990659d4657e67f38ece72d5eb47f4d9
Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
Diffstat (limited to 'func/env_setup.py')
-rw-r--r-- | func/env_setup.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/func/env_setup.py b/func/env_setup.py index 1f86f0ea..ea49337d 100644 --- a/func/env_setup.py +++ b/func/env_setup.py @@ -124,19 +124,19 @@ class Env_setup: LOG.info("Fetch compute ips through installer") ips = [] - installer_type = os.environ['INSTALLER_TYPE'] - installer_ip = os.environ['INSTALLER_IP'] - if installer_type.down.lower() != "fuel" or "compass": + installer_type = str(os.environ['INSTALLER_TYPE'].lower()) + installer_ip = str(os.environ['INSTALLER_IP']) + if installer_type not in ["fuel", "compass"]: raise RuntimeError("%s is not supported" % installer_type) - if installer_ip: + if not installer_ip: raise RuntimeError("undefine environment variable INSTALLER_IP") - cmd = "bash ./fetch_compute_ip.sh -i %s -a %s" % \ + cmd = "bash ./func/fetch_compute_ips.sh -i %s -a %s" % \ (installer_type, installer_ip) + LOG.info(cmd) os.system(cmd) home = expanduser("~") - os.chdir(home) - with open("ips.log", "r") as file: + with open(home + "/ips.log", "r") as file: data = file.read() if data: ips.extend(data.rstrip('\n').split('\n')) |