1 ###############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # szilard.cserey@ericsson.com
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ###############################################################################
14 from dea import DeploymentEnvironmentAdapter
20 ASTUTE_YAML = '/etc/fuel/astute.yaml'
26 python transplant_fuel_settings.py <deafile>
30 def parse_arguments():
31 if len(sys.argv) != 2:
34 dea_file = sys.argv[-1]
35 check_file_exists(dea_file)
39 def transplant(dea, astute):
40 fuel_conf = dea.get_fuel_config()
41 for key in fuel_conf.iterkeys():
42 if key == 'ADMIN_NETWORK':
43 for skey in fuel_conf[key].iterkeys():
44 astute[key][skey] = fuel_conf[key][skey]
46 astute[key] = fuel_conf[key]
51 dea_file = parse_arguments()
52 check_file_exists(ASTUTE_YAML)
53 dea = DeploymentEnvironmentAdapter(dea_file)
54 with io.open(ASTUTE_YAML) as stream:
55 astute = yaml.load(stream)
56 transplant(dea, astute)
57 with io.open(ASTUTE_YAML, 'w') as stream:
58 yaml.dump(astute, stream, default_flow_style=False)
61 if __name__ == '__main__':