diff options
author | 2018-02-13 03:17:49 +0000 | |
---|---|---|
committer | 2018-02-13 03:49:22 +0000 | |
commit | ef798eee7e223b908361c7c79278cd347128a039 (patch) | |
tree | 633452756fd69c55ec7ce685a8e63f83e73305f4 /functest/api/resources/v1/testcases.py | |
parent | 7598ab763d31ca4f901043722c19635b73f00d3f (diff) |
Read env vars instead of using CONST in API
Also, improve the way of getting env values.
JIRA: FUNCTEST-933
Change-Id: Ia66bbaf683df03c2874fafe578b84bb78a4f3fd1
Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'functest/api/resources/v1/testcases.py')
-rw-r--r-- | functest/api/resources/v1/testcases.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/functest/api/resources/v1/testcases.py b/functest/api/resources/v1/testcases.py index 01571548..bc21c6fa 100644 --- a/functest/api/resources/v1/testcases.py +++ b/functest/api/resources/v1/testcases.py @@ -127,10 +127,10 @@ class V1Testcase(ApiResource): result = 'FAIL' env_info = { - 'installer': CONST.__getattribute__('INSTALLER_TYPE'), - 'scenario': CONST.__getattribute__('DEPLOY_SCENARIO'), - 'build_tag': CONST.__getattribute__('BUILD_TAG'), - 'ci_loop': CONST.__getattribute__('CI_LOOP') + 'installer': os.environ.get('INSTALLER_TYPE', None), + 'scenario': os.environ.get('DEPLOY_SCENARIO', None), + 'build_tag': os.environ.get('BUILD_TAG', None), + 'ci_loop': os.environ.get('CI_LOOP', 'daily') } result = { 'task_id': args.get('task_id'), @@ -146,7 +146,7 @@ class V1Testcase(ApiResource): config = ConfigParser.RawConfigParser() config.read( pkg_resources.resource_filename('functest', 'ci/logging.ini')) - log_path = os.path.join(CONST.__getattribute__('dir_results'), + log_path = os.path.join(getattr(CONST, 'dir_results'), '{}.log'.format(task_id)) config.set('handler_file', 'args', '("{}",)'.format(log_path)) |