Add support for batch shutdown of OVS switches.

This saves about 10 seconds for a 200 switch network.
This commit is contained in:
Bob Lantz
2014-02-06 17:56:32 -08:00
parent 9cf9b7b223
commit 06115a0456
2 changed files with 10 additions and 0 deletions
+7
View File
@@ -985,6 +985,13 @@ class OVSSwitch( Switch ):
'"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: ] )