count = 0
import reboot
+from reboot import pcu_name
import soltesz
import plc
import threadpool
import syncplcdb
-def pcu_name(pcu):
- if pcu['hostname'] is not None and pcu['hostname'] is not "":
- return pcu['hostname']
- elif pcu['ip'] is not None and pcu['ip'] is not "":
- return pcu['ip']
- else:
- return None
-
def nmap_portstatus(status):
ps = {}
l_nmap = status.split()
count += 1
print "%d %s %s" % (count, nodename, externalState['nodes'][pcu_id]['values'])
- soltesz.dbDump(config.dbname, externalState, 'php')
+ soltesz.dbDump(config.dbname, externalState)
# this will be called when an exception occurs within a thread
def handle_exception(request, result):
def main():
global externalState
- externalState = soltesz.if_cached_else(1, config.dbname, lambda : externalState, 'php')
+ externalState = soltesz.if_cached_else(1, config.dbname, lambda : externalState)
cohash = {}
if config.increment:
if config.filename == "":
print "Calling API GetPCUs() : refresh(%s)" % config.refresh
l_pcus = soltesz.if_cached_else_refresh(1,
- config.refresh, "pculist", lambda : plc.GetPCUs(), 'php')
+ config.refresh, "pculist", lambda : plc.GetPCUs())
l_pcus = [pcu['pcu_id'] for pcu in l_pcus]
else:
l_pcus = config.getListFromFile(config.filename)
except Exception, err:
print "Exception: %s" % err
print "Saving data... exitting."
- soltesz.dbDump(config.dbname, externalState, 'php')
+ soltesz.dbDump(config.dbname, externalState)
sys.exit(0)