From 1ef12e450a916ceae355e664e020887536a577ca Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Thu, 12 Jul 2018 01:34:37 +0000 Subject: [PATCH] Apparently Python 3 types aren't ordered --- mininet/net.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mininet/net.py b/mininet/net.py index d7bbf4f..29d3876 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -549,7 +549,8 @@ class Mininet( object ): switch.start( self.controllers ) started = {} for swclass, switches in groupby( - sorted( self.switches, key=type ), type ): + sorted( self.switches, + key=lambda s: str( type( s ) ) ), type ): switches = tuple( switches ) if hasattr( swclass, 'batchStartup' ): success = swclass.batchStartup( switches ) @@ -576,7 +577,8 @@ class Mininet( object ): info( '*** Stopping %i switches\n' % len( self.switches ) ) stopped = {} for swclass, switches in groupby( - sorted( self.switches, key=type ), type ): + sorted( self.switches, + key=lambda s: str( type( s ) ) ), type ): switches = tuple( switches ) if hasattr( swclass, 'batchShutdown' ): success = swclass.batchShutdown( switches )