Skip to content
Snippets Groups Projects
Commit 9cf9b7b2 authored by Bob Lantz's avatar Bob Lantz
Browse files

Clean things up slightly.

parent 1fda4865
No related branches found
No related tags found
No related merge requests found
......@@ -47,24 +47,26 @@ def cleanup():
cleanUpScreens()
info( "*** Removing excess kernel datapaths\n" )
dps = sh( "ps ax | egrep -o 'dp[0-9]+' | sed 's/dp/nl:/'" ).split( '\n' )
dps = sh( "ps ax | egrep -o 'dp[0-9]+' | sed 's/dp/nl:/'" ).splitlines()
for dp in dps:
if dp != '':
if dp:
sh( 'dpctl deldp ' + dp )
info( "*** Removing OVS datapaths" )
dps = sh("ovs-vsctl --timeout=1 list-br").split( '\n' )
sh( "ovs-vsctl " + " -- ".join( "--if-exists del-br " + dp for dp in dps if dp ) )
dps = sh("ovs-vsctl --timeout=1 list-br").strip().splitlines()
if dps:
sh( "ovs-vsctl " + " -- ".join( "--if-exists del-br " + dp
for dp in dps if dp ) )
# And in case the above didn't work...
dps = sh("ovs-vsctl --timeout=1 list-br").split( '\n' )
dps = sh("ovs-vsctl --timeout=1 list-br").strip().splitlines()
for dp in dps:
if dp:
sh( 'ovs-vsctl del-br ' + dp )
sh( 'ovs-vsctl del-br ' + dp )
info( "*** Removing all links of the pattern foo-ethX\n" )
links = sh( r"ip link show | egrep -o '([-_.[:alnum:]]+-eth[[:digit:]]+)'" ).split( '\n' )
links = sh( "ip link show | "
"egrep -o '([-_.[:alnum:]]+-eth[[:digit:]]+)'" ).splitlines()
for link in links:
if link != '':
if link:
sh( "ip link del " + link )
info( "*** Cleanup complete.\n" )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment