Bug fixing Netns emulation
[nepi.git] / src / nepi / resources / linux / netns / netnsemulation.py
index 5d6aae4..4ad8062 100644 (file)
@@ -32,7 +32,7 @@ import threading
 
 @clsinit_copy
 class LinuxNetNSEmulation(LinuxApplication, NetNSEmulation):
-    _rtype = "LinuxNetNSEmulation"
+    _rtype = "linux::netns::Emulation"
 
     @classmethod
     def _register_attributes(cls):
@@ -174,6 +174,26 @@ class LinuxNetNSEmulation(LinuxApplication, NetNSEmulation):
 
             self.set_ready()
 
+    def do_start(self):
+        """ Starts  execution execution
+
+        """
+        self.info("Starting")
+
+        if self.state == ResourceState.READY:
+            self.set_started()
+        else:
+            msg = " Failed to execute command '%s'" % command
+            self.error(msg, out, err)
+            raise RuntimeError, msg
+
+    def do_stop(self):
+        """ Stops simulation execution
+
+        """
+        if self.state == ResourceState.STARTED:
+            self.set_stopped()
+
     def do_release(self):
         self.info("Releasing resource")