From 4271613aa56e614bfcfe3e728a1b918d2fba706c Mon Sep 17 00:00:00 2001 From: Michael Heca Date: Fri, 18 Apr 2014 16:14:12 +0200 Subject: [PATCH 1/2] module docker_image - default tag latest Fix constant rebuild of image if no tag specified. --- library/cloud/docker_image | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/cloud/docker_image b/library/cloud/docker_image index 2f5a02b4521..0bc3b10a038 100644 --- a/library/cloud/docker_image +++ b/library/cloud/docker_image @@ -164,7 +164,7 @@ class DockerImageManager: for i in images: # Docker-py version >= 0.3 (Docker API >= 1.8) if 'RepoTags' in i: - repotag = '%s:%s' % (getattr(self, 'name', ''), getattr(self, 'tag', 'latest')) + repotag = ':'.join([self.name, self.tag]) if not self.name or repotag in i['RepoTags']: filtered_images.append(i) # Docker-py version < 0.3 (Docker API < 1.8) @@ -188,7 +188,7 @@ def main(): argument_spec = dict( path = dict(required=False, default=None), name = dict(required=True), - tag = dict(required=False, default=""), + tag = dict(required=False, default="latest"), nocache = dict(default=False, type='bool'), state = dict(default='present', choices=['absent', 'present', 'build']), docker_url = dict(default='unix://var/run/docker.sock'), From ebac5dfbcead5819e866af9550b14f31253be937 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Thu, 8 May 2014 21:04:55 -0500 Subject: [PATCH 2/2] Updating docstring for docker_image based on new default for tag --- library/cloud/docker_image | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/cloud/docker_image b/library/cloud/docker_image index 0bc3b10a038..ce46d615c0a 100644 --- a/library/cloud/docker_image +++ b/library/cloud/docker_image @@ -45,7 +45,7 @@ options: description: - Image tag to work with required: false - default: "" + default: "latest" aliases: [] nocache: description: