This commit changes the 'soltesz.py' module into 'moncommands.py' and
[monitor.git] / sitebad.py
index eccaa28..c9e0033 100755 (executable)
@@ -6,7 +6,7 @@ import string
 import time
 
 
-import soltesz
+import database
 import comon
 import threadpool
 import syncplcdb
@@ -24,13 +24,13 @@ count = 0
 
 def main(config):
        global externalState
-       externalState = soltesz.if_cached_else(1, config.dbname, lambda : externalState) 
+       externalState = database.if_cached_else(1, config.dbname, lambda : externalState) 
        if config.increment:
                # update global round number to force refreshes across all nodes
                externalState['round'] += 1
 
        l_nodes = syncplcdb.create_plcdb()
-       l_plcsites = soltesz.dbLoad("l_plcsites")
+       l_plcsites = database.dbLoad("l_plcsites")
 
        if config.site:
                l_sites = [config.site]
@@ -59,12 +59,12 @@ def checkAndRecordState(l_sites, l_plcsites):
                        count += 1
 
                if count % 20 == 0:
-                       soltesz.dbDump(config.dbname, externalState)
+                       database.dbDump(config.dbname, externalState)
 
-       soltesz.dbDump(config.dbname, externalState)
+       database.dbDump(config.dbname, externalState)
 
-fb = soltesz.dbLoad('findbad')
-lb2hn = soltesz.dbLoad("plcdb_lb2hn")
+fb = database.dbLoad('findbad')
+lb2hn = database.dbLoad("plcdb_lb2hn")
 
 def getnodesup(nodelist):
        up = 0
@@ -144,5 +144,5 @@ if __name__ == '__main__':
                print traceback.print_exc()
                print "Exception: %s" % err
                print "Saving data... exitting."
-               soltesz.dbDump(config.dbname, externalState)
+               database.dbDump(config.dbname, externalState)
                sys.exit(0)