From 0e4b470ee2fae16f8b2efafd8c10e8c22b54ac62 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Tue, 27 Sep 2016 00:36:11 -0400 Subject: [PATCH] Let docker-py handle decoding and JSON parsing of stream data. Fixes #4930. --- lib/ansible/modules/cloud/docker/docker_image.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/docker/docker_image.py b/lib/ansible/modules/cloud/docker/docker_image.py index 0a9ab09096f..7d97d984190 100644 --- a/lib/ansible/modules/cloud/docker/docker_image.py +++ b/lib/ansible/modules/cloud/docker/docker_image.py @@ -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'])