diff --git a/bin/mn b/bin/mn index 8dd0d41..8e04df2 100755 --- a/bin/mn +++ b/bin/mn @@ -113,7 +113,6 @@ class MininetRunner( object ): index = sys.argv.index( '--custom' ) if len( sys.argv ) > index + 1: custom = sys.argv[ index + 1 ] - print "custom = %s" % custom self.parseCustomFile( custom ) else: raise Exception( 'Custom file name not found' ) diff --git a/mininet/cli.py b/mininet/cli.py index f28904d..98bfd30 100644 --- a/mininet/cli.py +++ b/mininet/cli.py @@ -47,8 +47,8 @@ class CLI( Cmd ): def __init__( self, mininet ): self.mn = mininet + self.nodelist = self.mn.hosts + self.mn.switches + self.mn.controllers self.nodemap = {} # map names to Node objects - self.nodelist = self.mn.switches + self.mn.hosts + self.mn.controllers for node in self.nodelist: self.nodemap[ node.name ] = node Cmd.__init__( self ) @@ -91,7 +91,7 @@ class CLI( Cmd ): for switch in self.mn.switches: info( '%s <->', switch.name ) for intf in switch.intfs: - node = switch.connection[ intf ] + node, name = switch.connection[ intf ] info( ' %s' % node.name ) info( '\n' ) @@ -118,12 +118,12 @@ class CLI( Cmd ): def do_intfs( self, args ): "List interfaces." - for node in self.mn.nodes.values(): + for node in self.nodelist: info( '%s: %s\n' % ( node.name, ' '.join( node.intfs ) ) ) def do_dump( self, args ): "Dump node info." - for node in self.mn.nodes.values(): + for node in self.nodelist: info( '%s\n' % node ) def do_exit( self, args ): diff --git a/mininet/net.py b/mininet/net.py index 4d4dfcb..00abdda 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -384,7 +384,7 @@ class Mininet( object ): info( '\n' ) info( '*** Stopping %i switches\n' % len( self.switches ) ) for switch in self.switches: - info( '%s ' % switch.name ) + info( switch.name ) switch.stop() info( '\n' ) info( '*** Stopping %i controllers\n' % len( self.controllers ) )