ec_shutdown
[nepi.git] / src / nepi / resources / linux / udptunnel.py
index 1d23736..4dae96c 100644 (file)
@@ -31,6 +31,9 @@ import time
 @clsinit_copy
 class UdpTunnel(LinuxApplication):
     _rtype = "UdpTunnel"
+    _help = "Constructs a tunnel between two Linux endpoints using a UDP connection "
+    _backend = "linux"
+
 
     @classmethod
     def _register_attributes(cls):
@@ -138,7 +141,6 @@ class UdpTunnel(LinuxApplication):
         msg = " Failed to connect endpoints "
         
         if proc.poll():
-            self.fail()
             self.error(msg, out, err)
             raise RuntimeError, msg
     
@@ -151,7 +153,6 @@ class UdpTunnel(LinuxApplication):
             (out, err), proc = endpoint.node.check_errors(self.run_home(endpoint))
             # Out is what was written in the stderr file
             if err:
-                self.fail()
                 msg = " Failed to start command '%s' " % command
                 self.error(msg, out, err)
                 raise RuntimeError, msg
@@ -199,7 +200,7 @@ class UdpTunnel(LinuxApplication):
                 self.provision()
             except:
                 self.fail()
-                raise
+                return
  
             self.debug("----- READY ---- ")
             self.set_ready()
@@ -214,7 +215,6 @@ class UdpTunnel(LinuxApplication):
             msg = " Failed to execute command '%s'" % command
             self.error(msg, out, err)
             self.fail()
-            raise RuntimeError, msg
 
     def stop(self):
         """ Stops application execution
@@ -235,8 +235,8 @@ class UdpTunnel(LinuxApplication):
                     msg = " Failed to STOP tunnel"
                     self.error(msg, err1, err2)
                     self.fail()
+                    return
 
-        if self.state == ResourceState.STARTED:
             self.set_stopped()
 
     @property
@@ -308,7 +308,6 @@ class UdpTunnel(LinuxApplication):
         else:
             msg = "Couldn't retrieve %s" % filename
             self.error(msg, out, err)
-            self.fail()
             raise RuntimeError, msg
 
         return result