diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2016-07-26 18:07:55 +0200 |
---|---|---|
committer | Jonas Bjurel <jonas.bjurel@ericsson.com> | 2016-08-17 12:24:03 +0000 |
commit | 8b602ad490b427e5b97dd709e4d7905b500579e3 (patch) | |
tree | d1d5f55a18ab0bc8e01fa3540b1f4a5c54579239 /deploy/transplant_fuel_settings.py | |
parent | 3ec3fb2d1d316b656a13f9c1ca00cc8a7fcd51de (diff) |
deploy: Allow DEA to override bootstrap config
This commit does not change the current behavior in OPNFV, the
preconfigured fuel_bootstrap_cli.yaml from OPNFV ISO is still
used to replace the default settings / fuel-menu bootstrap cfg.
The only addition is the possibility to override the preconfigured
fuel_bootstrap_cli.yaml info using DEA.
JIRA: FUEL-155
Change-Id: I4e66b789fdf0a5b1af512a3efc84fedb72ce3b05
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'deploy/transplant_fuel_settings.py')
-rw-r--r-- | deploy/transplant_fuel_settings.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/deploy/transplant_fuel_settings.py b/deploy/transplant_fuel_settings.py index e57a4fbc6..318c633aa 100644 --- a/deploy/transplant_fuel_settings.py +++ b/deploy/transplant_fuel_settings.py @@ -18,6 +18,7 @@ from common import ( ) ASTUTE_YAML = '/etc/fuel/astute.yaml' +FUEL_BOOTSTRAP_CLI_YAML = '/opt/opnfv/fuel_bootstrap_cli.yaml' def usage(): @@ -47,15 +48,31 @@ def transplant(dea, astute): return astute +def transplant_bootstrap(astute, fuel_bootstrap_cli): + if 'BOOTSTRAP' in astute: + for skey in astute['BOOTSTRAP'].iterkeys(): + # FIXME: astute.yaml repos point to public ones instead of + # local mirrors, this filter should be removed when in sync + if skey != 'repos': + fuel_bootstrap_cli[skey] = astute['BOOTSTRAP'][skey] + return fuel_bootstrap_cli + def main(): dea_file = parse_arguments() check_file_exists(ASTUTE_YAML) + check_file_exists(FUEL_BOOTSTRAP_CLI_YAML) dea = DeploymentEnvironmentAdapter(dea_file) with io.open(ASTUTE_YAML) as stream: astute = yaml.load(stream) transplant(dea, astute) with io.open(ASTUTE_YAML, 'w') as stream: yaml.dump(astute, stream, default_flow_style=False) + # Update bootstrap config yaml with info from DEA/astute.yaml + with io.open(FUEL_BOOTSTRAP_CLI_YAML) as stream: + fuel_bootstrap_cli = yaml.load(stream) + transplant_bootstrap(astute, fuel_bootstrap_cli) + with io.open(FUEL_BOOTSTRAP_CLI_YAML, 'w') as stream: + yaml.dump(fuel_bootstrap_cli, stream, default_flow_style=False) if __name__ == '__main__': |