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: if not self.check_mode:
status = None status = None
try: try:
for line in self.client.push(repository, tag=tag, stream=True): for line in self.client.push(repository, tag=tag, stream=True, decode=True):
line = json.loads(line)
self.log(line, pretty_print=True) self.log(line, pretty_print=True)
if line.get('errorDetail'): if line.get('errorDetail'):
raise Exception(line['errorDetail']['message']) raise Exception(line['errorDetail']['message'])