Do not stay alive indefinitely, PL cleans up itself, but only IF tun_connect eventual...
authorClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Tue, 9 Aug 2011 17:58:58 +0000 (19:58 +0200)
committerClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Tue, 9 Aug 2011 17:58:58 +0000 (19:58 +0200)
src/nepi/testbeds/planetlab/scripts/tun_connect.py

index 84934ae..98fc311 100644 (file)
@@ -393,7 +393,12 @@ def pl_vif_stop(tun_path, tun_name):
         out.append(stdout.read())
         stdout.close()
         
-        while True:
+        if options.mode.startswith('pl-gre'):
+            lim = 120
+        else:
+            lim = 2
+        
+        for i in xrange(lim):
             ifaces = set(map(str.strip,os.popen("ip a | grep -o '%s'" % (tun_name,)).read().strip().split('\n')))
             if tun_name in ifaces:
                 time.sleep(1)