Skip to content
Snippets Groups Projects
Commit c1dc8057 authored by Bob Lantz's avatar Bob Lantz
Browse files

Correctly group switches for batch operations

parent ec9b23ba
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@
from mininet.net import Mininet
from mininet.topo import LinearTopo
from mininet.topolib import TreeTopo
from mininet.util import quietRun, errRun, retry
from mininet.util import quietRun, errRun
from mininet.examples.clustercli import CLI
from mininet.log import setLogLevel, debug, info, error
from mininet.clean import addCleanupCallback
......@@ -326,7 +326,8 @@ def isOldOVS( self ):
@classmethod
def batchStartup( cls, switches, **_kwargs ):
"Start up switches in per-server batches"
for server, switchGroup in groupby( switches, attrgetter( 'server' ) ):
key = attrgetter( 'server' )
for server, switchGroup in groupby( sorted( switches, key=key ), key ):
info( '(%s)' % server )
group = tuple( switchGroup )
switch = group[ 0 ]
......@@ -336,7 +337,8 @@ def batchStartup( cls, switches, **_kwargs ):
@classmethod
def batchShutdown( cls, switches, **_kwargs ):
"Stop switches in per-server batches"
for server, switchGroup in groupby( switches, attrgetter( 'server' ) ):
key = attrgetter( 'server' )
for server, switchGroup in groupby( sorted( switches, key=key ), key ):
info( '(%s)' % server )
group = tuple( switchGroup )
switch = group[ 0 ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment