Fixes port acquiring logic in DockerStandaloneHost

Previous code used integer keys in port map. But because
JSON doesn't support integer keys they were converted
to corresponding string representations and were not
found on subsequent deployments

Change-Id: I0477a043854a5ed78545d3b944397cdbf2352bd8
Closes-Bug: #1444681
This commit is contained in:
Stan Lagun 2015-04-16 03:05:36 +03:00
parent fe2cf73514
commit 52a4621626
1 changed files with 6 additions and 5 deletions

View File

@ -187,24 +187,25 @@ Methods:
- $portMap: $.getAttr(portMap, dict())
- $applicationPorts: $.getAttr(applicationPorts, dict())
- $key: format('{0}-{1}-{2}', $applicationPort.port, $applicationPort.protocol, $applicationName)
- If: $key in $applicationPorts
Then:
- Return: $applicationPorts[$key]
- Return: $applicationPorts.get($key)
- $port: $applicationPort.port
- $port: str($applicationPort.port)
- If: $port in $portMap
Then:
- $port: 1025
- $port: '1025'
- While: $port in $portMap
Do:
$port: $port + 1
- $port: str(int($port) + 1)
- $portMap[$port]: $applicationName
- $applicationPorts[$key]: $port
- $.setAttr(portMap, $portMap)
- $.setAttr(applicationPorts, $applicationPorts)
- Return: $port
- Return: int($port)
_releaseApplicationPorts: