ec_shutdown
[nepi.git] / src / nepi / execution / resource.py
index 95e31ff..18edeb0 100644 (file)
@@ -83,9 +83,22 @@ def clsinit_copy(cls):
 # Decorator to invoke class initialization method
 @clsinit
 class ResourceManager(Logger):
+    """ Base clase for all ResourceManagers. 
+    
+    A ResourceManger is specific to a resource type (e.g. Node, 
+    Switch, Application, etc) on a specific backend (e.g. PlanetLab, 
+    OMF, etc).
+
+    The ResourceManager instances are responsible for interacting with
+    and controlling concrete (physical or virtual) resources in the 
+    experimental backends.
+    
+    """
     _rtype = "Resource"
     _attributes = None
     _traces = None
+    _help = None
+    _backend = None
 
     @classmethod
     def _register_attribute(cls, attr):
@@ -187,6 +200,21 @@ class ResourceManager(Logger):
         """
         return copy.deepcopy(cls._traces.values())
 
+    @classmethod
+    def get_help(cls):
+        """ Returns the description of the type of Resource
+
+        """
+        return cls._help
+
+    @classmethod
+    def get_backend(cls):
+        """ Returns the identified of the backend (i.e. testbed, environment)
+        for the Resource
+
+        """
+        return cls._backend
+
     def __init__(self, ec, guid):
         super(ResourceManager, self).__init__(self.rtype())
         
@@ -375,6 +403,7 @@ class ResourceManager(Logger):
  
     def fail(self):
         self.set_failed()
+        self.ec.set_rm_failure()
 
     def set(self, name, value):
         """ Set the value of the attribute
@@ -713,7 +742,6 @@ class ResourceManager(Logger):
             self.debug("----- STARTING ---- ")
             self.deploy()
 
-
     def connect(self, guid):
         """ Performs actions that need to be taken upon associating RMs.
         This method should be redefined when necessary in child classes.