From 4971c7fe822489f6645e0334e06c27d947e3a73c Mon Sep 17 00:00:00 2001 From: Alexey Wasilyev Date: Sat, 16 Apr 2016 22:46:02 +0300 Subject: [PATCH] docker: support polling image by digest (#2932) --- lib/ansible/modules/cloud/docker/docker.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ansible/modules/cloud/docker/docker.py b/lib/ansible/modules/cloud/docker/docker.py index 85b7b8fceed..285c7483651 100644 --- a/lib/ansible/modules/cloud/docker/docker.py +++ b/lib/ansible/modules/cloud/docker/docker.py @@ -589,13 +589,13 @@ def get_split_image_tag(image): else: registry, resource = None, image - # now we can determine if image has a tag - if ':' in resource: - resource, tag = resource.split(':', 1) - if registry: - resource = '/'.join((registry, resource)) - if tag == "": - tag = "latest" + # now we can determine if image has a tag or a digest + for s in ['@',':']: + if s in resource: + resource, tag = resource.split(s, 1) + if registry: + resource = '/'.join((registry, resource)) + break else: tag = "latest" resource = image