Tweaks to pass code check.
This commit is contained in:
@@ -81,9 +81,9 @@ class MininetRunner( object ):
|
|||||||
self.parseArgs()
|
self.parseArgs()
|
||||||
self.setup()
|
self.setup()
|
||||||
self.begin()
|
self.begin()
|
||||||
|
|
||||||
def setCustom( self, name, value ):
|
def setCustom( self, name, value ):
|
||||||
print "got", self, name, value
|
"Set custom parameters for MininetRunner."
|
||||||
if name in ( 'topos', 'switches', 'hosts', 'controllers' ):
|
if name in ( 'topos', 'switches', 'hosts', 'controllers' ):
|
||||||
# Update dictionaries
|
# Update dictionaries
|
||||||
param = name.upper()
|
param = name.upper()
|
||||||
@@ -94,7 +94,7 @@ class MininetRunner( object ):
|
|||||||
else:
|
else:
|
||||||
# Add or modify global variable or class
|
# Add or modify global variable or class
|
||||||
globals()[ name ] = value
|
globals()[ name ] = value
|
||||||
|
|
||||||
def parseCustomFile( self, fileName ):
|
def parseCustomFile( self, fileName ):
|
||||||
"Parse custom file and add params before parsing cmd-line options."
|
"Parse custom file and add params before parsing cmd-line options."
|
||||||
custom = {}
|
custom = {}
|
||||||
@@ -104,7 +104,7 @@ class MininetRunner( object ):
|
|||||||
self.setCustom( name, custom[ name ] )
|
self.setCustom( name, custom[ name ] )
|
||||||
else:
|
else:
|
||||||
raise Exception( 'could not find custom file: %s' % fileName )
|
raise Exception( 'could not find custom file: %s' % fileName )
|
||||||
|
|
||||||
def parseArgs( self ):
|
def parseArgs( self ):
|
||||||
"""Parse command-line args and return options object.
|
"""Parse command-line args and return options object.
|
||||||
returns: opts parse options dict"""
|
returns: opts parse options dict"""
|
||||||
|
|||||||
+2
-2
@@ -91,8 +91,8 @@ class CLI( Cmd ):
|
|||||||
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, name = switch.connection[ intf ]
|
name = switch.connection[ intf ][ 1 ]
|
||||||
info( ' %s' % node.name )
|
info( ' %s' % name )
|
||||||
info( '\n' )
|
info( '\n' )
|
||||||
|
|
||||||
def do_sh( self, args ):
|
def do_sh( self, args ):
|
||||||
|
|||||||
Reference in New Issue
Block a user