summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzshi <zshi@redhat.com>2016-10-17 14:03:14 +0800
committerzshi <zshi@redhat.com>2016-10-17 14:03:14 +0800
commit031045275eb6a05b9be05bee14456d0ca92ab5fb (patch)
tree7f44289120425e190edad63ca20e8c089107c2f1
parent81ee53d97e9457e31f2d12f2741a4bbd54b5b332 (diff)
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 <zshi@redhat.com>
-rw-r--r--dovetail/container.py7
1 files changed, 7 insertions, 0 deletions
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'],