X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=nodeconfig.py;h=61d31f930a3a95ae0550cd34c227bac5f7c4261d;hb=6496f5b4a0220e4055fee76c97f92293f9559117;hp=0b23c7b2f502f1dab79fe6e70870cfba7ec20e2a;hpb=9c0dba25a0b0f7aaef274baed17d674533141ea7;p=monitor.git diff --git a/nodeconfig.py b/nodeconfig.py index 0b23c7b..61d31f9 100755 --- a/nodeconfig.py +++ b/nodeconfig.py @@ -9,11 +9,11 @@ from optparse import OptionParser from sets import Set from nodecommon import * -import soltesz +import database def main(): from config import config - fb = soltesz.dbLoad("findbad") + fb = database.dbLoad("findbad") parser = OptionParser() parser.set_defaults(nodelist=None, @@ -32,16 +32,16 @@ def main(): try: n = api.GetNodes(node)[0] - print n + #print n net = api.GetNodeNetworks(n['nodenetwork_ids'])[0] - print net + #print net node_keys = ['boot_state', 'key', 'last_updated', 'last_contact'] for k in node_keys: if 'last' in k: - print "%15s == %s" % (k, diff_time(net[k])) + print "%15s == %s" % (k, diff_time(n[k])) else: - print "%15s == %s" % (k, net[k]) + print "%15s == %s" % (k, n[k]) static_keys = ['method', 'ip', 'gateway', 'network', 'broadcast', 'netmask', 'dns1', 'dns2', 'mac', 'is_primary'] for k in static_keys: @@ -51,6 +51,7 @@ def main(): # print k, "==" , net[k] except: print "Error with %s" % node + import traceback; print traceback.print_exc() pass # commands: