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

Minor cleanup of mn/net and fixes for CLI.

All commands should work now.
parent c3a44400
No related branches found
No related tags found
No related merge requests found
...@@ -113,7 +113,6 @@ class MininetRunner( object ): ...@@ -113,7 +113,6 @@ class MininetRunner( object ):
index = sys.argv.index( '--custom' ) index = sys.argv.index( '--custom' )
if len( sys.argv ) > index + 1: if len( sys.argv ) > index + 1:
custom = sys.argv[ index + 1 ] custom = sys.argv[ index + 1 ]
print "custom = %s" % custom
self.parseCustomFile( custom ) self.parseCustomFile( custom )
else: else:
raise Exception( 'Custom file name not found' ) raise Exception( 'Custom file name not found' )
......
...@@ -47,8 +47,8 @@ class CLI( Cmd ): ...@@ -47,8 +47,8 @@ class CLI( Cmd ):
def __init__( self, mininet ): def __init__( self, mininet ):
self.mn = mininet self.mn = mininet
self.nodelist = self.mn.hosts + self.mn.switches + self.mn.controllers
self.nodemap = {} # map names to Node objects self.nodemap = {} # map names to Node objects
self.nodelist = self.mn.switches + self.mn.hosts + self.mn.controllers
for node in self.nodelist: for node in self.nodelist:
self.nodemap[ node.name ] = node self.nodemap[ node.name ] = node
Cmd.__init__( self ) Cmd.__init__( self )
...@@ -91,7 +91,7 @@ def do_net( self, args ): ...@@ -91,7 +91,7 @@ def do_net( self, args ):
for switch in self.mn.switches: for switch in self.mn.switches:
info( '%s <->', switch.name ) info( '%s <->', switch.name )
for intf in switch.intfs: for intf in switch.intfs:
node = switch.connection[ intf ] node, name = switch.connection[ intf ]
info( ' %s' % node.name ) info( ' %s' % node.name )
info( '\n' ) info( '\n' )
...@@ -118,12 +118,12 @@ def do_iperfudp( self, args ): ...@@ -118,12 +118,12 @@ def do_iperfudp( self, args ):
def do_intfs( self, args ): def do_intfs( self, args ):
"List interfaces." "List interfaces."
for node in self.mn.nodes.values(): for node in self.nodelist:
info( '%s: %s\n' % ( node.name, ' '.join( node.intfs ) ) ) info( '%s: %s\n' % ( node.name, ' '.join( node.intfs ) ) )
def do_dump( self, args ): def do_dump( self, args ):
"Dump node info." "Dump node info."
for node in self.mn.nodes.values(): for node in self.nodelist:
info( '%s\n' % node ) info( '%s\n' % node )
def do_exit( self, args ): def do_exit( self, args ):
......
...@@ -384,7 +384,7 @@ def stop( self ): ...@@ -384,7 +384,7 @@ def stop( self ):
info( '\n' ) info( '\n' )
info( '*** Stopping %i switches\n' % len( self.switches ) ) info( '*** Stopping %i switches\n' % len( self.switches ) )
for switch in self.switches: for switch in self.switches:
info( '%s ' % switch.name ) info( switch.name )
switch.stop() switch.stop()
info( '\n' ) info( '\n' )
info( '*** Stopping %i controllers\n' % len( self.controllers ) ) info( '*** Stopping %i controllers\n' % len( self.controllers ) )
......
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