Merge pull request #2268 from AdamWill/pull-18-stream
fix #2043: strip empty dict from end of 'pull' stream
This commit is contained in:
commit
4c722dd99a
1 changed files with 5 additions and 0 deletions
|
@ -1392,6 +1392,11 @@ class DockerManager(object):
|
|||
changes = list(self.client.pull(image, tag=tag, stream=True, **extra_params))
|
||||
try:
|
||||
last = changes[-1]
|
||||
# seems Docker 1.8 puts an empty dict at the end of the
|
||||
# stream; catch that and get the previous instead
|
||||
# https://github.com/ansible/ansible-modules-core/issues/2043
|
||||
if last.strip() == '{}':
|
||||
last = changes[-2]
|
||||
except IndexError:
|
||||
last = '{}'
|
||||
status = json.loads(last).get('status', '')
|
||||
|
|
Loading…
Reference in a new issue