summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2014-05-12 12:27:07 -0500
committerJames Cammarata <jimi@sngx.net>2014-05-21 14:55:20 -0500
commit9d8eee633d19c7a062ed5ced3412e6229ae3872e (patch)
tree8100e81539e0f9aab106eef9efd0fbc32b074d74
parent8cc71a6eece72f23b9cf00de134655443c0f5a31 (diff)
downloadansible-9d8eee633d19c7a062ed5ced3412e6229ae3872e.tar.gz
Make sure the docker data has a "Names" field before using it
Fixes #7363
-rw-r--r--library/cloud/docker4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/cloud/docker b/library/cloud/docker
index f808000255..188f14ab04 100644
--- a/library/cloud/docker
+++ b/library/cloud/docker
@@ -507,7 +507,9 @@ class DockerManager:
running_image, running_tag = self.get_split_image_tag(i['Image'])
running_command = i['Command'].strip()
- name_matches = (name and name in i['Names'])
+ name_matches = False
+ if i["Names"]:
+ name_matches = (name and name in i['Names'])
image_matches = (running_image == image)
tag_matches = (not tag or running_tag == tag)
# if a container has an entrypoint, `command` will actually equal