Change runtime variables in the OMF6 RC config file comment section
[nodemanager.git] / nodemanager.py
index cdd5e45..57c96c7 100755 (executable)
@@ -74,7 +74,10 @@ class NodeManager:
         # Deal with plugins directory
         if os.path.exists(self.options.path):
             sys.path.append(self.options.path)
-            plugins = [ os.path.split(os.path.splitext(x)[0])[1] for x in glob.glob( os.path.join(self.options.path,'*.py') ) ]
+            plugins = [ os.path.split(os.path.splitext(x)[0])[1]
+                        for x in glob.glob( os.path.join(self.options.path,'*.py') )
+                        if not x.endswith("/__init__.py")
+                        ]
             self.modules += plugins
         if self.options.user_module:
             assert self.options.user_module in self.modules
@@ -171,6 +174,9 @@ class NodeManager:
             return {}
 
     def run(self):
+        # make sure to create /etc/planetlab/virt so others can read that
+        # used e.g. in vsys-scripts's sliceip
+        tools.get_node_virt()
         try:
             if self.options.daemon: tools.daemon()
 
@@ -203,6 +209,12 @@ If this is not the case, please remove the pid file %s. -- exiting""" % (other_p
                     # if we fail to load any of these, it's really no need to go on any further
                     if module in NodeManager.core_modules:
                         logger.log("FATAL : failed to load core module %s"%module)
+                except AttributeError, err:
+                    # triggered when module doesn't have a 'start' method
+                    logger.log_exc ("ERROR while starting module %s - skipping:" % module)
+                    # if we fail to load any of these, it's really no need to go on any further
+                    if module in NodeManager.core_modules:
+                        logger.log("FATAL : failed to start core module %s"%module)
 
             # sort on priority (lower first)
             def sort_module_priority (m1,m2):