From 031045275eb6a05b9be05bee14456d0ca92ab5fb Mon Sep 17 00:00:00 2001 From: zshi Date: Mon, 17 Oct 2016 14:03:14 +0800 Subject: Get envs from environment variables to test multi-SUT JIRA: DOVETAIL-32 currently envs variable is hard-coded to specific values which are not suitable for multi-SUT platform, fix it by reading it from environment variable. this commit is for apex installer testing purpose. Change-Id: I2163b96208d42a91f2795de6a55b276b803dc5e8 Signed-off-by: zshi --- dovetail/container.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'dovetail') diff --git a/dovetail/container.py b/dovetail/container.py index 54c43adc..6ff3980d 100644 --- a/dovetail/container.py +++ b/dovetail/container.py @@ -7,6 +7,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # +import os import utils.dovetail_logger as dt_logger import utils.dovetail_utils as dt_utils from conf.dovetail_config import dovetail_config @@ -38,6 +39,12 @@ class Container: # sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa " docker_image = cls.get_docker_image(type) envs = dovetail_config[type]['envs'] + import re + for i in ['INSTALLER_TYPE', 'DEPLOY_SCENARIO', + 'DEPLOY_TYPE', 'CI_DEBUG']: + envs = re.sub("%s=(\w+)" % i, '%s=%s' % (i, os.getenv(i)), envs) + envs = re.sub("INSTALLER_IP=\d+\.?\d+\.?\d+\.?\d+", + 'INSTALLER_IP=' + os.getenv('INSTALLER_IP'), envs) opts = dovetail_config[type]['opts'] sshkey = '' result_volume = ' -v %s:%s ' % (dovetail_config['result_dir'], -- cgit 1.2.3-korg