mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-20 03:42:07 +02:00
Fix rewriting of LINC-OE config for long controller IPs (ONOS-834).
Change-Id: I1e60ca4dc4d5d444eca905e13e234ad781009755
This commit is contained in:
parent
93356bcabc
commit
cb9c0ba6c5
@ -248,11 +248,11 @@ def startOE( net ):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
info ('*** Setting multiple controllers in sys.config...\n' )
|
info ('*** Setting multiple controllers in sys.config...\n' )
|
||||||
searchStr = '{controllers,.*$'
|
searchStr = '\[{"Switch.*$'
|
||||||
ctrlStr = ''
|
ctrlStr = ''
|
||||||
for index in range(len(net.controllers)):
|
for index in range(len(net.controllers)):
|
||||||
ctrlStr += '{"Switch%d-Controller","%s",%d,tcp},' % (index, net.controllers[index].ip, net.controllers[index].port)
|
ctrlStr += '{"Switch%d-Controller","%s",%d,tcp},' % (index, net.controllers[index].ip, net.controllers[index].port)
|
||||||
replaceStr = '{controllers,[%s]},' % ctrlStr[:-1] # Cut off last comma
|
replaceStr = '[%s]},' % ctrlStr[:-1] # Cut off last comma
|
||||||
sedCmd = 'sed -i \'s/%s/%s/\' sys.config' % (searchStr, replaceStr)
|
sedCmd = 'sed -i \'s/%s/%s/\' sys.config' % (searchStr, replaceStr)
|
||||||
output = quietRun( sedCmd, shell=True )
|
output = quietRun( sedCmd, shell=True )
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user