merge from improvements on the 1.0 branch:
[monitor.git] / showlatlon.py
index af01bd7..951802a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-import plc
+from monitor.wrapper import plc, plccache
 api = plc.getAuthAPI()
 
 import sys
@@ -9,7 +9,7 @@ from datetime import datetime, timedelta
 
 import database
 import comon
-from nodecommon import color_pcu_state, datetime_fromstr
+from monitor.common import color_pcu_state, datetime_fromstr
 from nodehistory import get_filefromglob
 import time
 import traceback
@@ -83,12 +83,12 @@ def main():
                begin = time.strftime(format)
 
        d = datetime_fromstr(begin)
-       fbstr = get_filefromglob(d, "production.findbad")
-       fbpcustr = get_filefromglob(d, "production.findbadpcus")
+       fbstr = get_filefromglob(d, "production.findbad")[0]
+       fbpcustr = get_filefromglob(d, "production.findbadpcus")[0]
 
-       l_plcnodes = database.dbLoad("l_plcnodes")
-       l_plcsites = database.dbLoad("l_plcsites")
-       lb2hn = database.dbLoad("plcdb_lb2hn")
+       l_plcnodes = plccache.l_nodes
+       l_plcsites = plccache.l_sites
+       lb2hn = plccache.plcdb_lb2hn
        fb = archive.load(fbstr) 
        fbpcu = archive.load(fbpcustr)
        reboot.fb = fbpcu