X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=reboot.py;h=337b0b46f359fc173bf4283ced02445510b49873;hp=76cacd3d2fdcad353764d025775afa6ec98f2014;hb=944d143a6528c4157b71f51ed480aec806cbaa06;hpb=94cd174f6ce0bb3b2c8bceda0346e332037c6d8a diff --git a/reboot.py b/reboot.py index 76cacd3..337b0b4 100755 --- a/reboot.py +++ b/reboot.py @@ -11,8 +11,6 @@ import urllib2 import urllib import threading, popen2 import array, struct -#from socket import * -import socket import plc import base64 from subprocess import PIPE, Popen @@ -1167,12 +1165,16 @@ def pcu_name(pcu): else: return None -import database -fb =database.dbLoad("findbadpcus") +#import database +from monitor import database +fb = None def get_pcu_values(pcu_id): - # TODO: obviously, this shouldn't be loaded each time... - + global fb + if fb == None: + # this shouldn't be loaded each time... + fb = database.dbLoad("findbadpcus") + try: values = fb['nodes']["id_%s" % pcu_id]['values'] except: