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

Add support for batch shutdown of OVS switches.

This saves about 10 seconds for a 200 switch network.
parent 9cf9b7b2
No related branches found
No related tags found
No related merge requests found
......@@ -408,6 +408,9 @@ def stop( self ):
info( '*** Stopping %i terms\n' % len( self.terms ) )
self.stopXterms()
info( '*** Stopping %i switches\n' % len( self.switches ) )
swclass = type( self.switches[ 0 ] )
if False and self.switches and hasattr( swclass, 'batchShutdown' ):
swclass.batchShutdown( self.switches )
for switch in self.switches:
info( switch.name + ' ' )
switch.stop()
......
......@@ -985,6 +985,13 @@ def setup( cls ):
'"service openvswitch-switch start".\n' )
exit( 1 )
@classmethod
def batchShutdown( cls, switches ):
"Call ovs-vsctl del-br on all OVSSwitches in a list"
quietRun( 'ovs-vsctl ' +
' -- '.join( '--if-exists del-br %s' % s
for s in switches if type(s) == cls ) )
def dpctl( self, *args ):
"Run ovs-ofctl command"
return self.cmd( 'ovs-ofctl', args[ 0 ], self, *args[ 1: ] )
......
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