diff options
author | hongbo tian <hongbo.tianhongbo@huawei.com> | 2016-12-26 06:32:31 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-12-26 06:32:31 +0000 |
commit | 54912a083579570d7369490fe99973af5cb358bb (patch) | |
tree | d0c668c8f24640e1a62c970b42136ba9abe072fe | |
parent | f87b8d9136682c9617449bb8595230c074c5d8e3 (diff) | |
parent | 814683870c428a983cc0259ce7b7bec162635bfe (diff) |
Merge "dovetail tool: bugfix functest prepare_env fail"
-rw-r--r-- | dovetail/container.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/dovetail/container.py b/dovetail/container.py index b3450fa3..078d82d9 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 @@ -46,8 +47,13 @@ class Container: docker_image = cls.get_docker_image(type) envs = dovetail_config[type]['envs'] opts = dovetail_config[type]['opts'] - creds = ' -v %s:%s ' % (dovetail_config['creds'], - dovetail_config[type]['creds']) + + # 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']) + else: + creds = '' 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' % \ |