Fix rewriting of LINC-OE config for long controller IPs (ONOS-834).

Change-Id: I1e60ca4dc4d5d444eca905e13e234ad781009755
This commit is contained in:
Marc De Leenheer 2015-01-22 14:50:04 -08:00 committed by Gerrit Code Review
parent 93356bcabc
commit cb9c0ba6c5

View File

@ -248,11 +248,11 @@ def startOE( net ):
return False
info ('*** Setting multiple controllers in sys.config...\n' )
searchStr = '{controllers,.*$'
searchStr = '\[{"Switch.*$'
ctrlStr = ''
for index in range(len(net.controllers)):
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)
output = quietRun( sedCmd, shell=True )