diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2017-03-16 07:29:04 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-03-16 07:29:04 +0000 |
commit | 661e542b39bbbf1c6f104a793631edb9cf3903e2 (patch) | |
tree | a34bf75e03ee586b22491677d23e847bf5a46449 /functest/utils/functest_utils.py | |
parent | c88fd9ac48589b4cb28a5ba5486adde1a21ae74c (diff) | |
parent | 0c194ede4dd9eb46b61af49e85527fcc368a8fca (diff) |
Merge "env variable support for test DB url"
Diffstat (limited to 'functest/utils/functest_utils.py')
-rw-r--r-- | functest/utils/functest_utils.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index dbed811a..e5e755d7 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -151,7 +151,15 @@ def get_db_url(): """ Returns DB URL """ - return get_functest_config('results.test_db_url') + # TODO use CONST mechanism + try: + # if TEST_DB_URL declared in env variable, use it! + db_url = os.environ['TEST_DB_URL'] + except KeyError: + logger.info("DB URL not declared as env variable," + "use local configuration") + db_url = get_functest_config('results.test_db_url') + return db_url def logger_test_results(project, case_name, status, details): |