Change default controller for mn to ovsc (ovs-controller.)
Also add check to see if another controller is running - eventually we should really detect errors from starting the controller!!
This commit is contained in:
@@ -48,7 +48,7 @@ HOSTS = { 'proc': Host,
|
|||||||
'rt': custom( CPULimitedHost, sched='rt' ),
|
'rt': custom( CPULimitedHost, sched='rt' ),
|
||||||
'cfs': custom( CPULimitedHost, sched='cfs' ) }
|
'cfs': custom( CPULimitedHost, sched='cfs' ) }
|
||||||
|
|
||||||
CONTROLLERDEF = 'ref'
|
CONTROLLERDEF = 'ovsc'
|
||||||
CONTROLLERS = { 'ref': Controller,
|
CONTROLLERS = { 'ref': Controller,
|
||||||
'ovsc': OVSController,
|
'ovsc': OVSController,
|
||||||
'nox': NOX,
|
'nox': NOX,
|
||||||
|
|||||||
Vendored
+2
@@ -13,6 +13,8 @@ Package: mininet
|
|||||||
Architecture: any
|
Architecture: any
|
||||||
Depends:
|
Depends:
|
||||||
openvswitch-switch,
|
openvswitch-switch,
|
||||||
|
openvswitch-controller,
|
||||||
|
telnet,
|
||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${python:Depends},
|
${python:Depends},
|
||||||
${shlibs:Depends}
|
${shlibs:Depends}
|
||||||
|
|||||||
@@ -975,6 +975,20 @@ class Controller( Node ):
|
|||||||
self.port = port
|
self.port = port
|
||||||
Node.__init__( self, name, inNamespace=inNamespace,
|
Node.__init__( self, name, inNamespace=inNamespace,
|
||||||
ip=ip, **params )
|
ip=ip, **params )
|
||||||
|
self.cmd( 'ifconfig lo up' ) # Shouldn't be necessary
|
||||||
|
self.checkListening()
|
||||||
|
|
||||||
|
def checkListening( self ):
|
||||||
|
"Make sure no controllers are running on our port"
|
||||||
|
listening = self.cmd( "echo A | telnet -e A %s %d" %
|
||||||
|
( self.ip, self.port ) )
|
||||||
|
if 'Unable' not in listening:
|
||||||
|
servers = self.cmd( 'netstat -atp' ).split( '\n' )
|
||||||
|
pstr = ':%d ' % self.port
|
||||||
|
info = servers[ 0:1 ] + [ s for s in servers if pstr in s ]
|
||||||
|
raise Exception( "Please shut down the controller which is"
|
||||||
|
" running on port %d:\n" % self.port +
|
||||||
|
'\n'.join( info ) )
|
||||||
|
|
||||||
def start( self ):
|
def start( self ):
|
||||||
"""Start <controller> <args> on controller.
|
"""Start <controller> <args> on controller.
|
||||||
|
|||||||
Reference in New Issue
Block a user