adjust regex for finding mininet's links during cleanup

link names of the form "a-b-ethN" were previously interpreted
as "b-ethN". this change accepts link names with a dash, and
requires N to only contain digits.
This commit is contained in:
Andrew Ferguson
2014-01-19 18:33:27 -05:00
parent dfd79bde56
commit 07e3da08d0
+1 -1
View File
@@ -59,7 +59,7 @@ def cleanup():
sh( 'ovs-vsctl del-br ' + dp ) sh( 'ovs-vsctl del-br ' + dp )
info( "*** Removing all links of the pattern foo-ethX\n" ) info( "*** Removing all links of the pattern foo-ethX\n" )
links = sh( r"ip link show | egrep -o '(\w+-eth\w+)'" ).split( '\n' ) links = sh( r"ip link show | egrep -o '([-_[:alnum:]]+-eth[[:digit:]]+)'" ).split( '\n' )
for link in links: for link in links:
if link != '': if link != '':
sh( "ip link del " + link ) sh( "ip link del " + link )