From 52a46216268d322ecbf49a695245e95cd4d81382 Mon Sep 17 00:00:00 2001 From: Stan Lagun Date: Thu, 16 Apr 2015 03:05:36 +0300 Subject: [PATCH] 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 --- .../package/Classes/DockerStandaloneHost.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/DockerStandaloneHost/package/Classes/DockerStandaloneHost.yaml b/DockerStandaloneHost/package/Classes/DockerStandaloneHost.yaml index ba35ceb..04d137b 100644 --- a/DockerStandaloneHost/package/Classes/DockerStandaloneHost.yaml +++ b/DockerStandaloneHost/package/Classes/DockerStandaloneHost.yaml @@ -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: