summaryrefslogtreecommitdiffstats
path: root/dovetail/container.py
diff options
context:
space:
mode:
authorLeo wang <grakiss.wanglei@huawei.com>2017-09-28 07:36:57 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-28 07:36:57 +0000
commit465f738554c1c401707036a055577b35f7c06dca (patch)
tree4aa49e53170649fefc6bdaf39cfbf7847057a138 /dovetail/container.py
parent63c2e2aa4b8d86349a767f611123ceafc19fa6d6 (diff)
parent98ff39a0bb75e2ae07b4af77ddb127ffaeb4ce5b (diff)
Merge "Make Yardstick log level can be set by CLI"
Diffstat (limited to 'dovetail/container.py')
-rw-r--r--dovetail/container.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/dovetail/container.py b/dovetail/container.py
index 14045165..ff92fa4a 100644
--- a/dovetail/container.py
+++ b/dovetail/container.py
@@ -149,14 +149,19 @@ class Container(object):
# CI_DEBUG is used for showing the debug logs of the upstream projects
# BUILD_TAG is the unique id for this test
- envs = ' -e CI_DEBUG=true -e NODE_NAME=master'
+ envs = ' -e NODE_NAME=master'
+ DEBUG = os.getenv('DEBUG')
+ if DEBUG is not None and DEBUG.lower() == "true":
+ envs = envs + ' -e CI_DEBUG=true'
+ else:
+ envs = envs + ' -e CI_DEBUG=false'
envs = envs + ' -e BUILD_TAG=%s-%s' % (dovetail_config['build_tag'],
testcase_name)
hosts_config = ""
hosts_config_file = os.path.join(dovetail_config['config_dir'],
'hosts.yaml')
- try:
+ if os.path.isfile(hosts_config_file):
with open(hosts_config_file) as f:
hosts_info = yaml.safe_load(f)
if hosts_info['hosts_info']:
@@ -165,10 +170,6 @@ class Container(object):
hosts_config += " --add-host "
hosts_config += str(host)
cls.logger.debug('Get hosts info {}.'.format(host))
- except Exception:
- cls.logger.warn('Failed to get hosts info in {}, '
- 'maybe some issues with domain name resolution.'
- .format(hosts_config_file))
config = ""
if type.lower() == "functest":