Call super(deleteIntfs)
Maybe this is better - maybe not. ;-p
This commit is contained in:
+4
-9
@@ -996,9 +996,7 @@ class UserSwitch( Switch ):
|
|||||||
deleteIntfs: delete interfaces? (True)"""
|
deleteIntfs: delete interfaces? (True)"""
|
||||||
self.cmd( 'kill %ofdatapath' )
|
self.cmd( 'kill %ofdatapath' )
|
||||||
self.cmd( 'kill %ofprotocol' )
|
self.cmd( 'kill %ofprotocol' )
|
||||||
if deleteIntfs:
|
super( UserSwitch, self ).stop( deleteIntfs )
|
||||||
self.deleteIntfs()
|
|
||||||
|
|
||||||
|
|
||||||
class OVSLegacyKernelSwitch( Switch ):
|
class OVSLegacyKernelSwitch( Switch ):
|
||||||
"""Open VSwitch legacy kernel-space switch using ovs-openflowd.
|
"""Open VSwitch legacy kernel-space switch using ovs-openflowd.
|
||||||
@@ -1048,8 +1046,7 @@ class OVSLegacyKernelSwitch( Switch ):
|
|||||||
deleteIntfs: delete interfaces? (True)"""
|
deleteIntfs: delete interfaces? (True)"""
|
||||||
quietRun( 'ovs-dpctl del-dp ' + self.dp )
|
quietRun( 'ovs-dpctl del-dp ' + self.dp )
|
||||||
self.cmd( 'kill %ovs-openflowd' )
|
self.cmd( 'kill %ovs-openflowd' )
|
||||||
if deleteIntfs:
|
super( OVSLegacyKernelSwitch, self ).stop( deleteIntfs )
|
||||||
self.deleteIntfs()
|
|
||||||
|
|
||||||
|
|
||||||
class OVSSwitch( Switch ):
|
class OVSSwitch( Switch ):
|
||||||
@@ -1204,8 +1201,7 @@ class OVSSwitch( Switch ):
|
|||||||
self.cmd( 'ovs-vsctl del-br', self )
|
self.cmd( 'ovs-vsctl del-br', self )
|
||||||
if self.datapath == 'user':
|
if self.datapath == 'user':
|
||||||
self.cmd( 'ip link del', self )
|
self.cmd( 'ip link del', self )
|
||||||
if deleteIntfs:
|
super( OVSSwitch, self ).stop( deleteIntfs )
|
||||||
self.deleteIntfs()
|
|
||||||
|
|
||||||
|
|
||||||
OVSKernelSwitch = OVSSwitch
|
OVSKernelSwitch = OVSSwitch
|
||||||
@@ -1273,8 +1269,7 @@ class IVSSwitch( Switch ):
|
|||||||
deleteIntfs: delete interfaces? (True)"""
|
deleteIntfs: delete interfaces? (True)"""
|
||||||
self.cmd( 'kill %ivs' )
|
self.cmd( 'kill %ivs' )
|
||||||
self.cmd( 'wait' )
|
self.cmd( 'wait' )
|
||||||
if deleteIntfs:
|
super( IVSSwitch, self ).stop( deleteIntfs )
|
||||||
self.deleteIntfs()
|
|
||||||
|
|
||||||
def attach( self, intf ):
|
def attach( self, intf ):
|
||||||
"Connect a data port"
|
"Connect a data port"
|
||||||
|
|||||||
+4
-2
@@ -46,10 +46,12 @@ class LinuxBridge( Switch ):
|
|||||||
self.cmd( 'brctl addif', self, i )
|
self.cmd( 'brctl addif', self, i )
|
||||||
self.cmd( 'ifconfig', self, 'up' )
|
self.cmd( 'ifconfig', self, 'up' )
|
||||||
|
|
||||||
def stop( self ):
|
def stop( self, deleteIntfs=True ):
|
||||||
"Stop Linux bridge"
|
"""Stop Linux bridge
|
||||||
|
deleteIntfs: delete interfaces? (True)"""
|
||||||
self.cmd( 'ifconfig', self, 'down' )
|
self.cmd( 'ifconfig', self, 'down' )
|
||||||
self.cmd( 'brctl delbr', self )
|
self.cmd( 'brctl delbr', self )
|
||||||
|
super( LinuxBridge, self ).stop( deleteIntfs )
|
||||||
|
|
||||||
def dpctl( self, *args ):
|
def dpctl( self, *args ):
|
||||||
"Run brctl command"
|
"Run brctl command"
|
||||||
|
|||||||
Reference in New Issue
Block a user