remove config and options parameters from start function as nobody uses them
[nodemanager.git] / plugins / omf_resctl.py
index b8b5e16..4fd2e8e 100644 (file)
@@ -5,7 +5,7 @@
 # NodeManager plugin - first step of handling omf_controlled slices
 
 """
-Overwrites the 'resctl' tag of slivers controlled by OMF so sm.py does the right thing
+Overwrites the 'resctl' tag of slivers controlled by OMF so slivermanager.py does the right thing
 """
 
 import os
@@ -17,11 +17,11 @@ import logger
 
 priority = 50
 
-def start(options, conf):
+def start():
     logger.log("omf_resctl: plugin starting up...")
 
 def GetSlivers(data, conf = None, plc = None):
-    if 'accounts' not in data: 
+    if 'accounts' not in data:
         logger.log_missing_data("omf_resctl.GetSlivers",'accounts')
         return
 
@@ -32,8 +32,12 @@ def GetSlivers(data, conf = None, plc = None):
         # xxx might need to clean up more deeply..
         return
 
+    # as hrn is set only at AddNode-time, upgraded myplcs might still miss this
+    # clue: just overwrite the hostname of all nodes
+    # for node in GetNodes(): UpdateNode(node['node_id'],{'hostname':node['hostname']})
     try:
         node_hrn = data['hrn']
+        if not hrn: raise Exception,"Empty hrn"
     except:
         node_hrn='default   # Failed to read hrn from GetSlivers, please upgrade PLCAPI'