X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Fnetns%2Fnetnsemulation.py;h=904be9f13358fa888a1cdc1e3ca2982df3145cd0;hb=6285ca51026efb69642eea9dfc7c480e722d84a9;hp=5d6aae437b0a1defc22afb293a924109e48832a7;hpb=23d041fe2f0d9badf6d637009e2d42a4794325c1;p=nepi.git diff --git a/src/nepi/resources/linux/netns/netnsemulation.py b/src/nepi/resources/linux/netns/netnsemulation.py index 5d6aae43..904be9f1 100644 --- a/src/nepi/resources/linux/netns/netnsemulation.py +++ b/src/nepi/resources/linux/netns/netnsemulation.py @@ -3,9 +3,8 @@ # Copyright (C) 2014 INRIA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -32,7 +31,7 @@ import threading @clsinit_copy class LinuxNetNSEmulation(LinuxApplication, NetNSEmulation): - _rtype = "LinuxNetNSEmulation" + _rtype = "linux::netns::Emulation" @classmethod def _register_attributes(cls): @@ -174,6 +173,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") @@ -208,9 +227,9 @@ class LinuxNetNSEmulation(LinuxApplication, NetNSEmulation): @property def _dependencies(self): if self.node.use_rpm: - return ( " python python-devel mercurial unzip bridge-utils iproute") + return (" python python-devel mercurial unzip bridge-utils iproute") elif self.node.use_deb: - return ( " python python-dev mercurial unzip bridge-utils iproute") + return (" python python-dev mercurial unzip bridge-utils iproute") return "" @property