Docker does not output Status after pull anymore.

- Docker 1.12 on CemtoOS7 does not output status line anymore.
- Do not rely on Docker output to verify if the image was the latest.

(cherry picked from commit 5f3c887c38)
pull/25292/head
Konrad Klimaszewski 8 years ago committed by James Cammarata
parent b05b5b9347
commit 2e5b4a9b2c

@ -430,13 +430,10 @@ class AnsibleDockerClient(Client):
Pull an image Pull an image
''' '''
self.log("Pulling image %s:%s" % (name, tag)) self.log("Pulling image %s:%s" % (name, tag))
alreadyToLatest = False old_tag = self.find_image(name, tag)
try: try:
for line in self.pull(name, tag=tag, stream=True, decode=True): for line in self.pull(name, tag=tag, stream=True, decode=True):
self.log(line, pretty_print=True) self.log(line, pretty_print=True)
if line.get('status'):
if line.get('status').startswith('Status: Image is up to date for'):
alreadyToLatest = True
if line.get('error'): if line.get('error'):
if line.get('errorDetail'): if line.get('errorDetail'):
error_detail = line.get('errorDetail') error_detail = line.get('errorDetail')
@ -448,6 +445,8 @@ class AnsibleDockerClient(Client):
except Exception as exc: except Exception as exc:
self.fail("Error pulling image %s:%s - %s" % (name, tag, str(exc))) self.fail("Error pulling image %s:%s - %s" % (name, tag, str(exc)))
return self.find_image(name, tag), alreadyToLatest new_tag = self.find_image(name, tag)
return new_tag, old_tag == new_tag

Loading…
Cancel
Save