From 391773a662ca190e0b41bd9c5293826ed24828d9 Mon Sep 17 00:00:00 2001 From: peusterm Date: Mon, 14 Mar 2016 17:40:43 +0100 Subject: [PATCH] Ensure that ryu is killed --- src/emuvim/dcemulator/net.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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() + -- 2.25.1