Skip to content

Commit 92b601a

Browse files
committed
Allow fail-mode to be set.
Probably we should have a generic mechanism to specify OVS options.
1 parent 350fdbf commit 92b601a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

mininet/node.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -827,11 +827,12 @@ def stop( self ):
827827
class OVSSwitch( Switch ):
828828
"Open vSwitch switch. Depends on ovs-vsctl."
829829

830-
def __init__( self, name, **params ):
830+
def __init__( self, name, failMode='secure', **params ):
831831
"""Init.
832832
name: name for switch
833-
defaultMAC: default MAC as unsigned int; random value if None"""
833+
failMode: controller loss behavior (secure|open)"""
834834
Switch.__init__( self, name, **params )
835+
self.failMode = failMode
835836

836837
@classmethod
837838
def setup( cls ):
@@ -884,7 +885,7 @@ def start( self, controllers ):
884885
# Annoyingly, --if-exists option seems not to work
885886
self.cmd( 'ovs-vsctl del-br', self )
886887
self.cmd( 'ovs-vsctl add-br', self )
887-
self.cmd( 'ovs-vsctl set-fail-mode', self, 'secure' )
888+
self.cmd( 'ovs-vsctl set-fail-mode', self, self.failMode )
888889
for intf in self.intfList():
889890
if not intf.IP():
890891
self.attach( intf )

0 commit comments

Comments
 (0)