Skip to content
Snippets Groups Projects
Commit f32a5468 authored by Brandon Heller's avatar Brandon Heller
Browse files

Fix NOX breakage

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

Also use more sensible temporary variable name.
parent e4370f7e
No related branches found
No related tags found
No related merge requests found
...@@ -44,10 +44,10 @@ HOSTS = { 'process': Host } ...@@ -44,10 +44,10 @@ HOSTS = { 'process': Host }
CONTROLLERDEF = 'ref' CONTROLLERDEF = 'ref'
# a and b are the name and inNamespace params. # a and b are the name and inNamespace params.
CONTROLLERS = { 'ref': Controller, CONTROLLERS = { 'ref': Controller,
'nox_dump': lambda a, b: NOX( a, b, 'packetdump' ), 'nox_dump': lambda name: NOX( name, 'packetdump' ),
'nox_pysw': lambda a, b: NOX( a, b, 'pyswitch' ), 'nox_pysw': lambda name: NOX( name, 'pyswitch' ),
'remote': lambda a, b: None, 'remote': lambda name: None,
'none': lambda a, b: None } 'none': lambda name: None }
# optional tests to run # optional tests to run
TESTS = [ 'cli', 'build', 'pingAll', 'pingPair', 'iperf', 'all', 'iperfUdp', TESTS = [ 'cli', 'build', 'pingAll', 'pingPair', 'iperf', 'all', 'iperfUdp',
......
...@@ -187,10 +187,10 @@ def addSwitch( self, name, mac=None, ip=None ): ...@@ -187,10 +187,10 @@ def addSwitch( self, name, mac=None, ip=None ):
def addController( self, controller ): def addController( self, controller ):
"""Add controller. """Add controller.
controller: Controller class""" controller: Controller class"""
controller = self.controller( 'c0', self.inNamespace ) controller_new = self.controller( 'c0' )
if controller: # allow controller-less setups if controller_new: # allow controller-less setups
self.controllers.append( controller ) self.controllers.append( controller_new )
self.nameToNode[ 'c0' ] = controller self.nameToNode[ 'c0' ] = controller_new
# Control network support: # Control network support:
# #
......
...@@ -661,10 +661,10 @@ def __init__( self, name, noxArgs=None, **kwargs ): ...@@ -661,10 +661,10 @@ def __init__( self, name, noxArgs=None, **kwargs ):
"""Init. """Init.
name: name to give controller name: name to give controller
noxArgs: list of args, or single arg, to pass to NOX""" noxArgs: list of args, or single arg, to pass to NOX"""
if type( noxArgs ) != list:
noxArgs = [ noxArgs ]
if not noxArgs: if not noxArgs:
noxArgs = [ 'packetdump' ] noxArgs = [ 'packetdump' ]
elif type( noxArgs ) != list:
noxArgs = [ noxArgs ]
if 'NOX_CORE_DIR' not in os.environ: if 'NOX_CORE_DIR' not in os.environ:
exit( 'exiting; please set missing NOX_CORE_DIR env var' ) exit( 'exiting; please set missing NOX_CORE_DIR env var' )
......
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