From e51024c84d5e50470374f253bfb1c70c934a8c2f Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Wed, 6 Jul 2016 17:14:19 -0400 Subject: [PATCH] Fix 'all' option for published_ports parameter. --- cloud/docker/docker_container.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cloud/docker/docker_container.py b/cloud/docker/docker_container.py index 0d0d22f1be0..a3e68b04c83 100644 --- a/cloud/docker/docker_container.py +++ b/cloud/docker/docker_container.py @@ -202,7 +202,7 @@ options: - fluentd - awslogs - splunk - defult: json-file + default: json-file required: false log_options: description: @@ -727,14 +727,17 @@ class TaskParameters(DockerBaseClass): except ValueError as exc: self.fail("Failed to convert %s to bytes: %s" % (param_name, exc)) - self.published_ports = self._parse_publish_ports() - self.ports = self._parse_exposed_ports(self.published_ports) - self.log("expose ports:") - self.log(self.ports, pretty_print=True) - self.publish_all_ports = None - if self.published_ports == 'all': + if 'all' in (port.lower() if isinstance(port, basestring) else port for port in self.published_ports): self.publish_all_ports = True self.published_ports = None + self.ports = None + else: + self.publish_all_ports = False + self.published_ports = self._parse_publish_ports() + self.ports = self._parse_exposed_ports(self.published_ports) + + self.log("expose ports:") + self.log(self.ports, pretty_print=True) self.links = self._parse_links(self.links)