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"]
26 for node in doc["nodes"]:
29 if node["role"] == arg[0]:
35 for node in doc["nodes"]:
42 result = result[level]
46 for node in doc["nodes"]:
47 if int(arg[0]) == node["id"]:
53 for node in doc["nodes"]:
54 if int(node["id"]) == int(id):
57 # for node in doc["nodes"]:
58 # if int(node["id"]) == int(arg[0]):
63 if not os.path.exists(infile):
64 sys.stderr.write("ERROR: The file "+infile+" could not be opened\n")
68 f1 = open(infile, 'r')
75 if cmd == "getProperty":
77 elif cmd == "getNodeRole":
79 elif cmd == "getNode":
84 print "No such command: %s" % cmd