diff --git a/bin/mn b/bin/mn index 2fe6378..a7e6ffb 100755 --- a/bin/mn +++ b/bin/mn @@ -44,10 +44,10 @@ HOSTS = { 'process': Host } CONTROLLERDEF = 'ref' # a and b are the name and inNamespace params. CONTROLLERS = { 'ref': Controller, - 'nox_dump': lambda a, b: NOX( a, b, 'packetdump' ), - 'nox_pysw': lambda a, b: NOX( a, b, 'pyswitch' ), - 'remote': lambda a, b: None, - 'none': lambda a, b: None } + 'nox_dump': lambda name: NOX( name, 'packetdump' ), + 'nox_pysw': lambda name: NOX( name, 'pyswitch' ), + 'remote': lambda name: None, + 'none': lambda name: None } # optional tests to run TESTS = [ 'cli', 'build', 'pingAll', 'pingPair', 'iperf', 'all', 'iperfUdp', diff --git a/mininet/net.py b/mininet/net.py index 57e1d56..7f6d266 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -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: # diff --git a/mininet/node.py b/mininet/node.py index 7c7b4b3..e9ab04c 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -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' )