Fixed problem for empty lists in cleanup.

Added retry() function for createLink to see if it helps (probably won't.)
Random edits to docs.
This commit is contained in:
Bob Lantz
2009-12-15 19:53:22 -08:00
parent 696a619d0e
commit 0a9ea29fd2
4 changed files with 19 additions and 9 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ def cleanup():
print "*** Removing all links of the pattern foo-ethX"
links = sh( "ip link show | egrep -o '(\w+-eth\w+)'" ).split( '\n' )
for link in links:
if link: sh( "ip link del " + link )
if link != '': sh( "ip link del " + link )
print "*** Removing excess controllers/ofprotocols/ofdatapaths/pings/noxes"
zombies = 'controller ofprotocol ofdatapath ping nox_core lt-nox_core'
@@ -43,7 +43,7 @@ def cleanup():
print "*** Removing excess kernel datapaths"
dps = sh( "ps ax | egrep -o 'dp[0-9]+' | sed 's/dp/nl:/'" ).split( '\n')
for dp in dps:
if dp: sh( 'ip link del ' + link )
if dp != '': sh( 'ip link del ' + link )
print "*** Removing junk from /tmp"
sh( 'rm -f /tmp/vconn* /tmp/vlogs* /tmp/*.out /tmp/*.log' )