From 08629f3b8ed75cfaecac5329cacba9659295c375 Mon Sep 17 00:00:00 2001 From: Aleksandar Topuzovic Date: Tue, 1 Mar 2016 11:30:23 +0000 Subject: Use decode on push and pull operations. Stream helper has the ability to decode the responses from strings to JSON. This commit enables this functionality on push and pull operations. Signed-off-by: Aleksandar Topuzovic --- docker/api/image.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/api/image.py b/docker/api/image.py index 8493b38..3e66347 100644 --- a/docker/api/image.py +++ b/docker/api/image.py @@ -148,7 +148,7 @@ class ImageApiMixin(object): self._raise_for_status(res) def pull(self, repository, tag=None, stream=False, - insecure_registry=False, auth_config=None): + insecure_registry=False, auth_config=None, decode=False): if insecure_registry: warnings.warn( INSECURE_REGISTRY_DEPRECATION_WARNING.format('pull()'), @@ -200,12 +200,12 @@ class ImageApiMixin(object): self._raise_for_status(response) if stream: - return self._stream_helper(response) + return self._stream_helper(response, decode=decode) return self._result(response) def push(self, repository, tag=None, stream=False, - insecure_registry=False): + insecure_registry=False, decode=False): if insecure_registry: warnings.warn( INSECURE_REGISTRY_DEPRECATION_WARNING.format('push()'), @@ -241,7 +241,7 @@ class ImageApiMixin(object): self._raise_for_status(response) if stream: - return self._stream_helper(response) + return self._stream_helper(response, decode=decode) return self._result(response) -- cgit v1.2.1