Fix NOX breakage

Controllers are no longer namespace-able, and all calls need one fewer
arg.

Also use more sensible temporary variable name.
This commit is contained in:
Brandon Heller
2010-03-23 00:48:35 -07:00
parent e4370f7ee7
commit f32a546855
3 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -187,10 +187,10 @@ class Mininet( object ):
def addController( self, controller ):
"""Add controller.
controller: Controller class"""
controller = self.controller( 'c0', self.inNamespace )
if controller: # allow controller-less setups
self.controllers.append( controller )
self.nameToNode[ 'c0' ] = controller
controller_new = self.controller( 'c0' )
if controller_new: # allow controller-less setups
self.controllers.append( controller_new )
self.nameToNode[ 'c0' ] = controller_new
# Control network support:
#
+2 -2
View File
@@ -661,10 +661,10 @@ class NOX( Controller ):
"""Init.
name: name to give controller
noxArgs: list of args, or single arg, to pass to NOX"""
if type( noxArgs ) != list:
noxArgs = [ noxArgs ]
if not noxArgs:
noxArgs = [ 'packetdump' ]
elif type( noxArgs ) != list:
noxArgs = [ noxArgs ]
if 'NOX_CORE_DIR' not in os.environ:
exit( 'exiting; please set missing NOX_CORE_DIR env var' )