diff options
author | Linda Wang <wangwulin@huawei.com> | 2017-08-15 06:49:51 +0000 |
---|---|---|
committer | Linda Wang <wangwulin@huawei.com> | 2017-08-15 07:54:19 +0000 |
commit | 161d40585a25291da548dfdade2838974e86ad58 (patch) | |
tree | 2cf7d0e6ce1f5dbf659ce838ba83c535f3bc1a6f /functest/utils/functest_utils.py | |
parent | e91c5d62fff72089ba52c35a198f1f7a40ee9e17 (diff) |
Obtain build_tag by CONST instead of get function
JIRA: FUNCTEST-763
Change-Id: I86b0b515a3d51df20a35c2aeb461a95d0c5797fd
Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'functest/utils/functest_utils.py')
-rw-r--r-- | functest/utils/functest_utils.py | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index 91781bd2..bf68e43a 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -107,7 +107,9 @@ def get_version(): # jenkins-functest-fuel-baremetal-weekly-master-8 # use regex to match branch info rule = "(dai|week)ly-(.+?)-[0-9]*" - build_tag = get_build_tag() + build_tag = CONST.__getattribute__('BUILD_TAG') + if not build_tag: + build_tag = 'none' m = re.search(rule, build_tag) if m: return m.group(2) @@ -128,19 +130,6 @@ def get_pod_name(): return "unknown-pod" -def get_build_tag(): - """ - Get build tag of jenkins jobs - """ - try: - build_tag = os.environ['BUILD_TAG'] - except KeyError: - logger.info("Impossible to retrieve the build tag") - build_tag = "none" - - return build_tag - - def logger_test_results(project, case_name, status, details): """ Format test case results for the logger @@ -148,7 +137,7 @@ def logger_test_results(project, case_name, status, details): pod_name = get_pod_name() scenario = get_scenario() version = get_version() - build_tag = get_build_tag() + build_tag = CONST.__getattribute__('BUILD_TAG') db_url = CONST.__getattribute__("results_test_db_url") logger.info( |