fixed runtime errors with moved files in model, and reboot
[monitor.git] / monitor / wrapper / plccache.py
index 73a6e57..978e6bb 100755 (executable)
@@ -21,6 +21,10 @@ def dsn_from_dsln(d_sites, id2lb, l_nodes):
        lb2hn = {}
        dsn = {}
        hn2lb = {}
+       for id in id2lb:
+               if id2lb[id] not in lb2hn:
+                       lb2hn[id2lb[id]] = []
+
        for node in l_nodes:
                # this won't reach sites without nodes, which I guess isn't a problem.
                if node['site_id'] in id2lb.keys():
@@ -100,6 +104,7 @@ def init():
        
        return l_nodes
 
+
 def create_plcdb():
 
        # get sites, and stats
@@ -132,7 +137,9 @@ def create_plcdb():
                database.dbDump("l_plcsites", l_sites)
        
        return l_nodes
-       
 
 if __name__ == '__main__':
        create_plcdb()
+else:
+       print "calling plccache init()"
+       init()