diff options
author | xudan <xudan16@huawei.com> | 2017-03-15 10:17:08 +0000 |
---|---|---|
committer | xudan <xudan16@huawei.com> | 2017-03-20 01:24:08 +0000 |
commit | 3cf37c9ac7b40a388f81fed13cfb0ad606dcd9a1 (patch) | |
tree | eb283d7c2693bf1fefefd7e0b7c59cca3107be02 /dovetail/container.py | |
parent | 04a464ac81ac43f536ba73af3666a149c97f8369 (diff) |
dovetail tool: change name of credentials from creds to openrc
1. change file name from openstack.creds to openrc.sh
2. change the cmd --creds to --openrc/-o
3. now the path of --openrc can be relative path no restrict to abspath
4. remove the useless "work_dir" in dovetail_config.yml
JIRA: DOVETAIL-369
JIRA: DOVETAIL-367
Change-Id: I2592438eef060f84132ff7fa226aea93ea947362
Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail/container.py')
-rw-r--r-- | dovetail/container.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/dovetail/container.py b/dovetail/container.py index 3c2c2944..4f6975fc 100644 --- a/dovetail/container.py +++ b/dovetail/container.py @@ -48,16 +48,19 @@ class Container(object): envs = dovetail_config[type]['envs'] opts = dovetail_config[type]['opts'] - # if file openstack.creds doesn't exist, creds need to be empty - if os.path.isfile(dovetail_config['creds']): - creds = ' -v %s:%s ' % (dovetail_config['creds'], - dovetail_config[type]['creds']) + # credentials file openrc.sh is neccessary + dovetail_config['openrc'] = os.path.abspath(dovetail_config['openrc']) + if os.path.isfile(dovetail_config['openrc']): + openrc = ' -v %s:%s ' % (dovetail_config['openrc'], + dovetail_config[type]['openrc']) else: - creds = '' + cls.logger.error("File %s is not exist", dovetail_config['openrc']) + return None + result_volume = ' -v %s:%s ' % (dovetail_config['result_dir'], dovetail_config[type]['result']['dir']) cmd = 'sudo docker run %s %s %s %s %s %s /bin/bash' % \ - (opts, envs, sshkey, creds, result_volume, docker_image) + (opts, envs, sshkey, openrc, result_volume, docker_image) dt_utils.exec_cmd(cmd, cls.logger) ret, container_id = \ dt_utils.exec_cmd("sudo docker ps | grep " + docker_image + |