mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-07 19:23:09 +00:00
Make sure the docker data has a "Names" field before using it
Fixes #7363
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user