Let docker-py handle decoding and JSON parsing of stream data. Fixes #4930.

This commit is contained in:
Chris Houseknecht 2016-09-27 00:36:11 -04:00 committed by Matt Clay
parent 9432adfaf7
commit 0e4b470ee2

View file

@ -424,8 +424,7 @@ class ImageManager(DockerBaseClass):
if not self.check_mode:
status = None
try:
for line in self.client.push(repository, tag=tag, stream=True):
line = json.loads(line)
for line in self.client.push(repository, tag=tag, stream=True, decode=True):
self.log(line, pretty_print=True)
if line.get('errorDetail'):
raise Exception(line['errorDetail']['message'])