Fix multi-interface port binding.

pull/18777/head
Chris Houseknecht 8 years ago committed by Matt Clay
parent bd3e1c77fe
commit 030dcccad4

@ -1410,7 +1410,7 @@ class Container(DockerBaseClass):
return entrypoint return entrypoint
def _get_expected_ports(self): def _get_expected_ports(self):
if self.parameters.published_ports is None: if not self.parameters.published_ports:
return None return None
expected_bound_ports = {} expected_bound_ports = {}
for container_port, config in self.parameters.published_ports.iteritems(): for container_port, config in self.parameters.published_ports.iteritems():
@ -1420,7 +1420,7 @@ class Container(DockerBaseClass):
expected_bound_ports[container_port] = [{'HostIp': "0.0.0.0", 'HostPort': ""}] expected_bound_ports[container_port] = [{'HostIp': "0.0.0.0", 'HostPort': ""}]
elif isinstance(config[0], tuple): elif isinstance(config[0], tuple):
expected_bound_ports[container_port] = [] expected_bound_ports[container_port] = []
for host_ip, host_port in config.iteritems(): for host_ip, host_port in config:
expected_bound_ports[container_port].append({ 'HostIp': host_ip, 'HostPort': str(host_port)}) expected_bound_ports[container_port].append({ 'HostIp': host_ip, 'HostPort': str(host_port)})
else: else:
expected_bound_ports[container_port] = [{'HostIp': config[0], 'HostPort': str(config[1])}] expected_bound_ports[container_port] = [{'HostIp': config[0], 'HostPort': str(config[1])}]

Loading…
Cancel
Save