diff options
author | Chris Houseknecht <chousekn@redhat.com> | 2016-07-12 12:37:38 -0400 |
---|---|---|
committer | Chris Houseknecht <chousekn@redhat.com> | 2016-07-12 16:29:45 -0400 |
commit | 1058094b64cce2d840623d880870030220d7ff19 (patch) | |
tree | f31e1d9d2b7172ca8cacd8f90e694fc2b44d049c | |
parent | 90b8281a5171b8042966399e3b9d0472da03b074 (diff) | |
download | ansible-modules-core-1058094b64cce2d840623d880870030220d7ff19.tar.gz |
Fix module failing when no ports are exposed
-rw-r--r-- | cloud/docker/docker_container.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/cloud/docker/docker_container.py b/cloud/docker/docker_container.py index 30834a19..5ef10653 100644 --- a/cloud/docker/docker_container.py +++ b/cloud/docker/docker_container.py @@ -126,7 +126,7 @@ options: description: - List of additional container ports to expose for port mappings or links. If the port is already exposed using EXPOSE in a Dockerfile, it does not - need to be xposed again. + need to be exposed again. default: null required: false aliases: @@ -738,15 +738,13 @@ class TaskParameters(DockerBaseClass): except ValueError as exc: self.fail("Failed to convert %s to bytes: %s" % (param_name, exc)) - if 'all' in (port.lower() if isinstance(port, basestring) else port for port in self.published_ports): + self.publish_all_ports = False + self.published_ports = self._parse_publish_ports() + if self.published_ports == 'all': 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.ports = self._parse_exposed_ports(self.published_ports) self.log("expose ports:") self.log(self.ports, pretty_print=True) |