net: allow batch shutdown of multiple types of switches
Each switch class will be called to shutdown its own instances.
This commit is contained in:
+2
-3
@@ -993,7 +993,7 @@ class OVSSwitch( Switch ):
|
||||
"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 ) )
|
||||
for s in switches ) )
|
||||
|
||||
def dpctl( self, *args ):
|
||||
"Run ovs-ofctl command"
|
||||
@@ -1110,8 +1110,7 @@ class IVSSwitch(Switch):
|
||||
def batchShutdown( cls, switches ):
|
||||
"Kill each IVS switch, to be waited on later in stop()"
|
||||
for switch in switches:
|
||||
if type(switch) == cls:
|
||||
switch.cmd( 'kill %ivs' )
|
||||
switch.cmd( 'kill %ivs' )
|
||||
|
||||
def start( self, controllers ):
|
||||
"Start up a new IVS switch"
|
||||
|
||||
Reference in New Issue
Block a user