Ticket 14: More incremental work - minor fixes to TUN cleanup
authorClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Thu, 28 Apr 2011 15:44:54 +0000 (17:44 +0200)
committerClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Thu, 28 Apr 2011 15:44:54 +0000 (17:44 +0200)
src/nepi/testbeds/planetlab/interfaces.py
src/nepi/testbeds/planetlab/rspawn.py

index a8de10d..cd0b7f0 100644 (file)
@@ -160,7 +160,7 @@ class TunIface(object):
         if self.peer_iface:
             self.peer_proto_impl.setup()
     
-    def destroy(self):
+    def cleanup(self):
         if self.peer_proto_impl:
             self.peer_proto_impl.shutdown()
             self.peer_proto_impl = None
index a1e0e43..7cd8910 100644 (file)
@@ -204,12 +204,12 @@ def remote_kill(pid, ppid, sudo = False,
 %(sudo)s kill %(pid)d
 for x in 1 2 3 4 5 6 7 8 9 0 ; do 
     sleep 0.1 
-    if [ `ps --ppid %(ppid)d -o pid | grep -c %(pid)d` == `0` ]; then
+    if [ `ps --ppid %(ppid)d -o pid | grep -c %(pid)d` == '0' ]; then
         break
     fi
     sleep 0.9
 done
-if [ `ps --ppid %(ppid)d -o pid | grep -c %(pid)d` != `0` ]; then
+if [ `ps --ppid %(ppid)d -o pid | grep -c %(pid)d` != '0' ]; then
     %(sudo)s kill -9 %(pid)d
 fi
 """ % {