Fix multi-interface port binding.

This commit is contained in:
Chris Houseknecht 2016-07-11 13:14:23 -04:00 committed by Matt Clay
parent bd3e1c77fe
commit 030dcccad4

View file

@ -1410,7 +1410,7 @@ class Container(DockerBaseClass):
return entrypoint
def _get_expected_ports(self):
if self.parameters.published_ports is None:
if not self.parameters.published_ports:
return None
expected_bound_ports = {}
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': ""}]
elif isinstance(config[0], tuple):
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)})
else:
expected_bound_ports[container_port] = [{'HostIp': config[0], 'HostPort': str(config[1])}]