ec_shutdown
[nepi.git] / src / nepi / resources / planetlab / tap.py
index 411eb51..991fa99 100644 (file)
@@ -36,6 +36,8 @@ PYTHON_VSYS_VERSION = "1.0"
 @clsinit_copy
 class PlanetlabTap(LinuxApplication):
     _rtype = "PlanetlabTap"
+    _help = "Creates a TAP device on a PlanetLab host"
+    _backend = "planetlab"
 
     @classmethod
     def _register_attributes(cls):
@@ -163,8 +165,8 @@ class PlanetlabTap(LinuxApplication):
                 self.provision()
             except:
                 self.fail()
-                raise
+                return
+
             self.debug("----- READY ---- ")
             self.set_ready()
 
@@ -178,7 +180,6 @@ class PlanetlabTap(LinuxApplication):
             msg = " Failed to execute command '%s'" % command
             self.error(msg, out, err)
             self.fail()
-            raise RuntimeError, msg
 
     def stop(self):
         command = self.get('command') or ''
@@ -204,8 +205,7 @@ class PlanetlabTap(LinuxApplication):
 
                 if out.strip().find(self.get("deviceName")) == -1: 
                     # tap is not running is not running (socket not found)
-                    self._finish_time = tnow()
-                    self._state = ResourceState.FINISHED
+                    self.finish()
 
             self._last_state_check = tnow()
 
@@ -241,7 +241,6 @@ class PlanetlabTap(LinuxApplication):
         else:
             msg = "Couldn't retrieve if_name"
             self.error(msg, out, err)
-            self.fail()
             raise RuntimeError, msg
 
         return if_name