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

Rename Controller.controller to .command

parent e30f2c99
No related branches found
No related tags found
No related merge requests found
...@@ -464,7 +464,7 @@ def __init__( self, name, **kwargs ): ...@@ -464,7 +464,7 @@ def __init__( self, name, **kwargs ):
"""Init. """Init.
name: name for the switch""" name: name for the switch"""
Switch.__init__( self, name, **kwargs ) Switch.__init__( self, name, **kwargs )
pathCheck( 'ofdatapath', 'ofprotocol', pathCheck( 'ofdatapath', 'ofprotocol',
moduleName='the OpenFlow reference user switch (openflow.org)' ) moduleName='the OpenFlow reference user switch (openflow.org)' )
@staticmethod @staticmethod
...@@ -621,10 +621,10 @@ class Controller( Node ): ...@@ -621,10 +621,10 @@ class Controller( Node ):
"""A Controller is a Node that is running (or has execed?) an """A Controller is a Node that is running (or has execed?) an
OpenFlow controller.""" OpenFlow controller."""
def __init__( self, name, inNamespace=False, controller='controller', def __init__( self, name, inNamespace=False, command='controller',
cargs='-v ptcp:%d', cdir=None, defaultIP="127.0.0.1", cargs='-v ptcp:%d', cdir=None, defaultIP="127.0.0.1",
port=6633 ): port=6633 ):
self.controller = controller self.command = command
self.cargs = cargs self.cargs = cargs
self.cdir = cdir self.cdir = cdir
self.port = port self.port = port
...@@ -634,17 +634,17 @@ def __init__( self, name, inNamespace=False, controller='controller', ...@@ -634,17 +634,17 @@ def __init__( self, name, inNamespace=False, controller='controller',
def start( self ): def start( self ):
"""Start <controller> <args> on controller. """Start <controller> <args> on controller.
Log to /tmp/cN.log""" Log to /tmp/cN.log"""
pathCheck( self.controller ) pathCheck( self.command )
cout = '/tmp/' + self.name + '.log' cout = '/tmp/' + self.name + '.log'
if self.cdir is not None: if self.cdir is not None:
self.cmd( 'cd ' + self.cdir ) self.cmd( 'cd ' + self.cdir )
self.cmd( self.controller + ' ' + self.cargs % self.port + self.cmd( self.command + ' ' + self.cargs % self.port +
' 1>' + cout + ' 2>' + cout + '&' ) ' 1>' + cout + ' 2>' + cout + '&' )
self.execed = False self.execed = False
def stop( self ): def stop( self ):
"Stop controller." "Stop controller."
self.cmd( 'kill %' + self.controller ) self.cmd( 'kill %' + self.command )
self.terminate() self.terminate()
def IP( self, intf=None ): def IP( self, intf=None ):
...@@ -682,7 +682,7 @@ def __init__( self, name, noxArgs=None, **kwargs ): ...@@ -682,7 +682,7 @@ def __init__( self, name, noxArgs=None, **kwargs ):
noxCoreDir = os.environ[ 'NOX_CORE_DIR' ] noxCoreDir = os.environ[ 'NOX_CORE_DIR' ]
Controller.__init__( self, name, Controller.__init__( self, name,
controller=noxCoreDir + '/nox_core', command=noxCoreDir + '/nox_core',
cargs='--libdir=/usr/local/lib -v -i ptcp:%s ' % self.port + cargs='--libdir=/usr/local/lib -v -i ptcp:%s ' % self.port +
' '.join( noxArgs ), ' '.join( noxArgs ),
cdir=noxCoreDir, **kwargs ) cdir=noxCoreDir, **kwargs )
......
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