From be2d4cc1c9eac7a663fcc1ab41396cee39460009 Mon Sep 17 00:00:00 2001 From: Stephen Jennings Date: Wed, 23 Aug 2017 09:10:53 -0700 Subject: [PATCH] Check for an existing docker_network before trying to modify it (#24048) This eliminates a TypeError in check mode. --- lib/ansible/modules/cloud/docker/docker_network.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/modules/cloud/docker/docker_network.py b/lib/ansible/modules/cloud/docker/docker_network.py index f5d37a503c..3c0f581ba1 100644 --- a/lib/ansible/modules/cloud/docker/docker_network.py +++ b/lib/ansible/modules/cloud/docker/docker_network.py @@ -308,6 +308,8 @@ class DockerNetworkManager(object): self.results['changed'] = True def disconnect_missing(self): + if not self.existing_network: + return containers = self.existing_network['Containers'] if not containers: return