From c1b48fb5c8830d76100a34156c979703e6dccd4d Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Thu, 15 Jan 2015 02:43:38 -0800 Subject: [PATCH] Stub out RemoteOVSSwitch.batchShutdown() Eventually we should implement true batch shutdown. In the mean time, we just ignore it. Note there's no good way that I know of for a subclass to remove a superclass method, so we changed the protocol a bit to require a return value of True. --- examples/cluster.py | 5 +++++ mininet/net.py | 4 ++-- mininet/node.py | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/cluster.py b/examples/cluster.py index 79d2eb0..8171361 100755 --- a/examples/cluster.py +++ b/examples/cluster.py @@ -292,6 +292,11 @@ class RemoteOVSSwitch( RemoteMixin, OVSSwitch ): return ( StrictVersion( cls.OVSVersions[ self.server ] ) < StrictVersion( '1.10' ) ) + @classmethod + def batchShutdown( cls, *args, **kwargs ): + "Not implemented yet" + return False + class RemoteLink( Link ): "A RemoteLink is a link between nodes which may be on different servers" diff --git a/mininet/net.py b/mininet/net.py index 5289ee5..aa7b569 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -505,8 +505,8 @@ class Mininet( object ): for swclass, switches in groupby( sorted( self.switches, key=type ), type ): switches = tuple( switches ) - if hasattr( swclass, 'batchShutdown' ): - swclass.batchShutdown( switches ) + if ( hasattr( swclass, 'batchShutdown' ) and + swclass.batchShutdown( switches ) ): stopped.update( { s: s for s in switches } ) for switch in self.switches: info( switch.name + ' ' ) diff --git a/mininet/node.py b/mininet/node.py index c9485f2..4117c0c 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -1103,6 +1103,7 @@ class OVSSwitch( Switch ): quietRun( 'ovs-vsctl ' + ' -- '.join( '--if-exists del-br %s' % s for s in switches ) ) + return True def dpctl( self, *args ): "Run ovs-ofctl command"