From: peusterm Date: Mon, 14 Mar 2016 16:40:43 +0000 (+0100) Subject: Ensure that ryu is killed X-Git-Tag: v3.1~162^2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=391773a662ca190e0b41bd9c5293826ed24828d9;p=osm%2Fvim-emu.git Ensure that ryu is killed --- diff --git a/src/emuvim/dcemulator/net.py b/src/emuvim/dcemulator/net.py index bc54293..81d16ab 100755 --- a/src/emuvim/dcemulator/net.py +++ b/src/emuvim/dcemulator/net.py @@ -154,9 +154,8 @@ class DCNetwork(Dockernet): def stop(self): # stop Ryu controller - self.ryu_process.terminate() - #self.ryu_process.kill() Dockernet.stop(self) + self.stopRyu() def CLI(self): CLI(self) @@ -217,4 +216,10 @@ class DCNetwork(Dockernet): ryu_cmd = 'ryu-manager' FNULL = open("/tmp/ryu.log", 'w') self.ryu_process = Popen([ryu_cmd, ryu_path, ryu_path2, ryu_option, ryu_of_port], stdout=FNULL, stderr=FNULL) - time.sleep(1) \ No newline at end of file + time.sleep(1) + + def stopRyu(self): + if self.ryu_process: + self.ryu_process.terminate() + self.ryu_process.kill() +