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.
release1.7.1
Peter Kolloch 11 years ago committed by James Cammarata
parent edb08b56fc
commit 29ff0df4b9

@ -484,6 +484,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():
@ -583,7 +590,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)

Loading…
Cancel
Save