git://git.onelab.eu
/
nodemanager-topo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e4d8591
)
Minor bug fixes
author
Andy Bavier
<acb@cs.princeton.edu>
Tue, 17 Feb 2009 21:47:41 +0000
(21:47 +0000)
committer
Andy Bavier
<acb@cs.princeton.edu>
Tue, 17 Feb 2009 21:47:41 +0000
(21:47 +0000)
topo.py
patch
|
blob
|
history
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)
"""
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:
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):
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:
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):
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
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:
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:
if not node in nodelist:
+ logger.log("%s" % nodelist)
teardown_virtual_link(slice, key, node)
teardown_virtual_link(slice, key, node)