Minor bug fixes
authorAndy Bavier <acb@cs.princeton.edu>
Tue, 17 Feb 2009 21:47:41 +0000 (21:47 +0000)
committerAndy Bavier <acb@cs.princeton.edu>
Tue, 17 Feb 2009 21:47:41 +0000 (21:47 +0000)
topo.py

diff --git a/topo.py b/topo.py
index 88327fd..4d4e4a9 100755 (executable)
--- a/topo.py
+++ b/topo.py
@@ -25,10 +25,11 @@ def run(cmd):
 
 
 """
-Check for existence of interface a<key>x<nodeid>
+Check for existence of interface d<key>x<nodeid>
 """
 def virtual_link(key, nodeid):
     name = "d%sx%s" % (key, nodeid)
+    # logger.log("Looking for iface %s" % name)
     if name in ifaces:
         return True
     else:
@@ -40,6 +41,7 @@ Create a "virtual link" for slice between here and nodeid.
 The key is used to create the EGRE tunnel.
 """
 def setup_virtual_link(slice, key, rate, myid, nodeid, ipaddr):
+    logger.log("Set up virtual link to node %d" % nodeid)
     if myid < nodeid:
         virtip = "10.%d.%d.2" % (myid, nodeid)
     else:
@@ -54,7 +56,7 @@ def setup_virtual_link(slice, key, rate, myid, nodeid, ipaddr):
 Tear down the "virtual link" for slice between here and nodeid.
 """
 def teardown_virtual_link(slice, key, nodeid):
-    logger.log("Tear down virtual link to node %d" % nodeid)
+    logger.log("Tear down virtual link to node %s" % nodeid)
     run(teardown_link_cmd + " %s %s %s" % (slice, nodeid, key))
     return
 
@@ -68,8 +70,9 @@ def clean_up_old_virtual_links(slice, key, nodelist):
     for iface in ifaces:
         m = re.match(pattern, iface)
         if m:
-            node = m.group(1)
+            node = int(m.group(1))
             if not node in nodelist:
+                logger.log("%s" % nodelist)
                 teardown_virtual_link(slice, key, node)