diff options
author | boucherv <valentin.boucher@orange.com> | 2016-08-11 09:06:09 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-08-11 09:06:09 +0000 |
commit | fe1cdb02640ddf9baae6d09a949a4648264dd482 (patch) | |
tree | 8b8c14c250a929cebb73f20ff6884fc714623296 /ci/prepare_env.py | |
parent | e648bdc9f4f52208a44936fd8732afbe256a20c2 (diff) | |
parent | 7eefbe8f7ec52d727e8e504e4ddd4ddb57cf569e (diff) |
Merge "Create config_functest patch to update the conf with scenario"
Diffstat (limited to 'ci/prepare_env.py')
-rwxr-xr-x | ci/prepare_env.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/ci/prepare_env.py b/ci/prepare_env.py index e31afd49..116b1a6e 100755 --- a/ci/prepare_env.py +++ b/ci/prepare_env.py @@ -46,10 +46,16 @@ CI_SCENARIO = "" CI_DEBUG = False REPOS_DIR = os.getenv('repos_dir') FUNCTEST_REPO = REPOS_DIR + '/functest/' +CONFIG_FUNCTEST_PATH = os.environ["CONFIG_FUNCTEST_YAML"] +CONFIG_PATCH_PATH = os.path.join(os.path.dirname( + CONFIG_FUNCTEST_PATH), "config_patch.yaml") -with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f: +with open(CONFIG_FUNCTEST_PATH) as f: functest_yaml = yaml.safe_load(f) +with open(CONFIG_PATCH_PATH) as f: + functest_patch_yaml = yaml.safe_load(f) + FUNCTEST_CONF_DIR = functest_yaml.get("general").get( "directories").get("dir_functest_conf") @@ -183,6 +189,21 @@ def source_rc_file(): logger.debug("Used credentials: %s" % str) +def patch_config_file(): + updated = False + for key in functest_patch_yaml: + if key in CI_SCENARIO: + new_functest_yaml = dict(ft_utils.merge_dicts( + functest_yaml, functest_patch_yaml[key])) + updated = True + + if updated: + 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 verify_deployment(): print_separator() logger.info("Verifying OpenStack services...") @@ -262,6 +283,7 @@ def main(): check_env_variables() create_directories() source_rc_file() + patch_config_file() verify_deployment() install_rally() |