Properly handle Docker image comparison for published_ports defined as IP::PORT

- Published port defined as IP::PORT where parsed in expected.parameters
  as 0.0.0.0::PORT leading to changed==True on every playbook run.

(cherry picked from commit 64f63a3cac)
pull/25292/head
Konrad Klimaszewski 9 years ago committed by James Cammarata
parent 4978566117
commit b05b5b9347

@ -1504,7 +1504,10 @@ class Container(DockerBaseClass):
if isinstance(container_port, int):
container_port = "%s/tcp" % container_port
if len(config) == 1:
expected_bound_ports[container_port] = [{'HostIp': "0.0.0.0", 'HostPort': ""}]
if isinstance(config[0], int):
expected_bound_ports[container_port] = [{'HostIp': "0.0.0.0", 'HostPort': config[0]}]
else:
expected_bound_ports[container_port] = [{'HostIp': config[0], 'HostPort': ""}]
elif isinstance(config[0], tuple):
expected_bound_ports[container_port] = []
for host_ip, host_port in config:

Loading…
Cancel
Save