aboutsummaryrefslogtreecommitdiffstats
path: root/functest/ci
diff options
context:
space:
mode:
authorJose Lausuch <jose.lausuch@ericsson.com>2017-06-02 08:19:12 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-06-02 08:19:12 +0000
commit8fde61d643c17b012659d8343ab3c06526958a05 (patch)
tree58dd3f40df636e8726b07aa6598ff7c03544a54d /functest/ci
parentcce3644b0b0186676de974d32e02219e2ae5dc50 (diff)
parent8e6b5934deef23386b8047b2f30a481ce42d32b8 (diff)
Merge "Use CONST to retrieve db_url rather than getter function"
Diffstat (limited to 'functest/ci')
-rwxr-xr-xfunctest/ci/prepare_env.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/functest/ci/prepare_env.py b/functest/ci/prepare_env.py
index 8e17a4fc..e03bc654 100755
--- a/functest/ci/prepare_env.py
+++ b/functest/ci/prepare_env.py
@@ -234,12 +234,15 @@ def source_rc_file():
CONST.__setattr__('OS_PASSWORD', value)
-def patch_config_file():
+def update_config_file():
patch_file(CONFIG_PATCH_PATH)
if pod_arch and pod_arch in arch_filter:
patch_file(CONFIG_AARCH64_PATCH_PATH)
+ if "TEST_DB_URL" in os.environ:
+ update_db_url()
+
def patch_file(patch_file_path):
logger.debug('Updating file: %s', patch_file_path)
@@ -257,7 +260,15 @@ def patch_file(patch_file_path):
os.remove(CONFIG_FUNCTEST_PATH)
with open(CONFIG_FUNCTEST_PATH, "w") as f:
f.write(yaml.dump(new_functest_yaml, default_style='"'))
- f.close()
+
+
+def update_db_url():
+ with open(CONFIG_FUNCTEST_PATH) as f:
+ functest_yaml = yaml.safe_load(f)
+
+ with open(CONFIG_FUNCTEST_PATH, "w") as f:
+ functest_yaml["results"]["test_db_url"] = os.environ.get('TEST_DB_URL')
+ f.write(yaml.dump(functest_yaml, default_style='"'))
def verify_deployment():
@@ -381,7 +392,7 @@ def main(**kwargs):
get_deployment_handler()
create_directories()
source_rc_file()
- patch_config_file()
+ update_config_file()
verify_deployment()
install_rally()
install_tempest()