From a4a4b6f4234d7b680660fb85faa66ea8283e21af Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Tue, 13 Oct 2015 10:34:08 +0000 Subject: [PATCH] Catch the second occurance of ExposedPorts as well --- lib/ansible/modules/cloud/docker/docker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/docker/docker.py b/lib/ansible/modules/cloud/docker/docker.py index 029f913ff29..ed44f279add 100644 --- a/lib/ansible/modules/cloud/docker/docker.py +++ b/lib/ansible/modules/cloud/docker/docker.py @@ -1071,7 +1071,7 @@ class DockerManager(object): for p in (self.exposed_ports or []): expected_exposed_ports.add("/".join(p)) - actually_exposed_ports = set((container["Config"]["ExposedPorts"] or {}).keys()) + actually_exposed_ports = set((container["Config"].get("ExposedPorts") or {}).keys()) if actually_exposed_ports != expected_exposed_ports: self.reload_reasons.append('exposed_ports ({0} => {1})'.format(actually_exposed_ports, expected_exposed_ports))