Call super(deleteIntfs)

Maybe this is better - maybe not. ;-p
This commit is contained in:
Bob Lantz
2014-12-04 07:36:53 -08:00
parent 643c9f912f
commit d754a7ceea
2 changed files with 8 additions and 11 deletions
+4 -9
View File
@@ -996,9 +996,7 @@ class UserSwitch( Switch ):
deleteIntfs: delete interfaces? (True)"""
self.cmd( 'kill %ofdatapath' )
self.cmd( 'kill %ofprotocol' )
if deleteIntfs:
self.deleteIntfs()
super( UserSwitch, self ).stop( deleteIntfs )
class OVSLegacyKernelSwitch( Switch ):
"""Open VSwitch legacy kernel-space switch using ovs-openflowd.
@@ -1048,8 +1046,7 @@ class OVSLegacyKernelSwitch( Switch ):
deleteIntfs: delete interfaces? (True)"""
quietRun( 'ovs-dpctl del-dp ' + self.dp )
self.cmd( 'kill %ovs-openflowd' )
if deleteIntfs:
self.deleteIntfs()
super( OVSLegacyKernelSwitch, self ).stop( deleteIntfs )
class OVSSwitch( Switch ):
@@ -1204,8 +1201,7 @@ class OVSSwitch( Switch ):
self.cmd( 'ovs-vsctl del-br', self )
if self.datapath == 'user':
self.cmd( 'ip link del', self )
if deleteIntfs:
self.deleteIntfs()
super( OVSSwitch, self ).stop( deleteIntfs )
OVSKernelSwitch = OVSSwitch
@@ -1273,8 +1269,7 @@ class IVSSwitch( Switch ):
deleteIntfs: delete interfaces? (True)"""
self.cmd( 'kill %ivs' )
self.cmd( 'wait' )
if deleteIntfs:
self.deleteIntfs()
super( IVSSwitch, self ).stop( deleteIntfs )
def attach( self, intf ):
"Connect a data port"
+4 -2
View File
@@ -46,10 +46,12 @@ class LinuxBridge( Switch ):
self.cmd( 'brctl addif', self, i )
self.cmd( 'ifconfig', self, 'up' )
def stop( self ):
"Stop Linux bridge"
def stop( self, deleteIntfs=True ):
"""Stop Linux bridge
deleteIntfs: delete interfaces? (True)"""
self.cmd( 'ifconfig', self, 'down' )
self.cmd( 'brctl delbr', self )
super( LinuxBridge, self ).stop( deleteIntfs )
def dpctl( self, *args ):
"Run brctl command"