diff options
author | Linda Wang <wangwulin@huawei.com> | 2017-08-17 07:50:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-08-17 07:50:30 +0000 |
commit | de754b305ad82defae6e2c7bc5a358184aede6b4 (patch) | |
tree | 747e1e08e92b679dd60f5eeaeab7a706250fe300 /functest/utils | |
parent | d1b2993af8c742a74282efc27d75c479d275d2cb (diff) | |
parent | 161d40585a25291da548dfdade2838974e86ad58 (diff) |
Merge "Obtain build_tag by CONST instead of get function"
Diffstat (limited to 'functest/utils')
-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( |