Merge OVSBatch into OVSSwitch

Note that we are changing the interface of batchStartup/Shutdown
slightly so that the method can choose not to start some of the
switches. We might wish to refine this a bit...
This commit is contained in:
Bob Lantz
2015-01-26 18:01:20 -08:00
parent 574d634fc2
commit bdad3e8c8e
4 changed files with 86 additions and 82 deletions
+8 -6
View File
@@ -485,9 +485,11 @@ class Mininet( object ):
for swclass, switches in groupby(
sorted( self.switches, key=type ), type ):
switches = tuple( switches )
if ( hasattr( swclass, 'batchStartup' ) and
swclass.batchStartup( switches ) ):
started.update( { s: s for s in switches } )
if hasattr( swclass, 'batchStartup' ):
print "STARTING", switches
success = swclass.batchStartup( switches )
print "STARTED", success
started.update( { s: s for s in success } )
info( '\n' )
if self.waitConn:
self.waitConnected()
@@ -512,9 +514,9 @@ class Mininet( object ):
for swclass, switches in groupby(
sorted( self.switches, key=type ), type ):
switches = tuple( switches )
if ( hasattr( swclass, 'batchShutdown' ) and
swclass.batchShutdown( switches ) ):
stopped.update( { s: s for s in switches } )
if hasattr( swclass, 'batchShutdown' ):
success = swclass.batchShutdown( switches )
stopped.update( { s: s for s in success } )
for switch in self.switches:
info( switch.name + ' ' )
if switch not in stopped: