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 ###############################################################################
15 from dea import DeploymentEnvironmentAdapter
17 check_file_exists = common.check_file_exists
19 ASTUTE_YAML = '/etc/fuel/astute.yaml'
25 python transplant_fuel_settings.py <deafile>
29 def parse_arguments():
30 if len(sys.argv) != 2:
33 dea_file = sys.argv[-1]
34 check_file_exists(dea_file)
38 def transplant(dea, astute):
39 fuel_conf = dea.get_fuel_config()
40 for key in fuel_conf.iterkeys():
41 if key == 'ADMIN_NETWORK':
42 for skey in fuel_conf[key].iterkeys():
43 astute[key][skey] = fuel_conf[key][skey]
45 astute[key] = fuel_conf[key]
50 dea_file = parse_arguments()
51 check_file_exists(ASTUTE_YAML)
52 dea = DeploymentEnvironmentAdapter(dea_file)
53 with io.open(ASTUTE_YAML) as stream:
54 astute = yaml.load(stream)
55 transplant(dea, astute)
56 with io.open(ASTUTE_YAML, 'w') as stream:
57 yaml.dump(astute, stream, default_flow_style=False)
60 if __name__ == '__main__':