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.
pull/25014/head
Konrad Klimaszewski 7 years ago committed by Toshio Kuratomi
parent 5b39368108
commit 64f63a3cac

@ -1537,7 +1537,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