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 ##############################################################################
21 print "Node %d " % node["id"]
22 print " Mac: %s" % node["adminMac"]
23 print " Role: %s" % node["role"]
35 for node in doc["nodes"]:
38 # Get property arg2 from arg1
39 def getNodeProperty(arg):
43 for node in doc["nodes"]:
44 if node["id"] == int(id):
58 if not os.path.exists(infile):
59 sys.stderr.write("ERROR: The file "+infile+" could not be opened\n")
63 f1 = open(infile, 'r')
72 elif cmd == "getNodes":
74 elif cmd == "getNodeProperty":
79 print "No such command: %s" % cmd
83 #print yaml.dump(doc, default_flow_style=False)