5 from dea import DeploymentEnvironmentAdapter
7 check_file_exists = common.check_file_exists
12 python transplant_fuel_settings.py <deafile>
15 def parse_arguments():
16 if len(sys.argv) != 2:
19 dea_file = sys.argv[-1]
20 check_file_exists(dea_file)
23 def transplant(dea, astute):
24 fuel_conf = dea.get_fuel_config()
25 for key in fuel_conf.iterkeys():
26 if key == 'ADMIN_NETWORK':
27 for skey in fuel_conf[key].iterkeys():
28 astute[key][skey] = fuel_conf[key][skey]
30 astute[key] = fuel_conf[key]
34 dea_file = parse_arguments()
35 astute_yaml = '/etc/fuel/astute.yaml'
36 check_file_exists(astute_yaml)
37 dea = DeploymentEnvironmentAdapter(dea_file)
38 with io.open(astute_yaml) as stream:
39 astute = yaml.load(stream)
40 transplant(dea, astute)
41 with io.open(astute_yaml, 'w') as stream:
42 yaml.dump(astute, stream, default_flow_style=False)
45 if __name__ == '__main__':