From 7a6354f753bd43552b92fa0c9d08ea34b32a85d2 Mon Sep 17 00:00:00 2001 From: Peter Kolloch Date: Thu, 12 Jun 2014 11:48:57 +0200 Subject: [PATCH] Hack to fix #7738: Allow tag in image parameter of docker module It also defaults to the "latest" tag for pulling the image instead of pulling all versions. --- library/cloud/docker | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/cloud/docker b/library/cloud/docker index 79c6145bc61..c980df4096f 100644 --- a/library/cloud/docker +++ b/library/cloud/docker @@ -477,6 +477,13 @@ class DockerManager: else: return image, tag + def get_split_full_image_tag(self, image): + tag = "latest" + if image.find(':') > 0: + return image.split(':') + else: + return image, tag + def get_summary_counters_msg(self): msg = "" for k, v in self.counters.iteritems(): @@ -576,7 +583,8 @@ class DockerManager: try: containers = do_create(count, params) except: - self.client.pull(params['image']) + image, tag = self.get_split_full_image_tag(params['image']) + self.client.pull(image, tag = tag) self.increment_counter('pull') containers = do_create(count, params)