2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB and others.
4 # stefan.k.berg@ericsson.com
5 # jonas.bjurel@ericsson.com
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
17 if len(sys.argv) != 3:
18 sys.stderr.write("Usage: "+sys.argv[0]+" <outfile> <outnamespace>\n")
21 infile = "/etc/fuel/astute.yaml"
22 if not os.path.exists(infile):
23 sys.stderr.write("ERROR: The file "+infile+" could not be opened\n")
27 namespace = sys.argv[2]
29 f1 = open(infile, 'r')
37 del(doc["ADMIN_NETWORK"]["mac"])
38 del(doc["ADMIN_NETWORK"]["interface"])
40 for copy in [ "ADMIN_NETWORK", "HOSTNAME", "DNS_DOMAIN", "DNS_SEARCH",
41 "DNS_UPSTREAM", "NTP1", "NTP2", "NTP3", "ADMIN_NETWORK", "FUEL_ACCESS" ]:
42 out[namespace][copy] = doc[copy]
44 f2 = open(outfile, 'a')
45 f2.write(yaml.dump(out, default_flow_style=False))