summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandar Topuzovic <atopuzovic@demonware.net>2016-03-01 11:30:23 +0000
committerAleksandar Topuzovic <atopuzovic@demonware.net>2016-03-01 11:54:14 +0000
commit08629f3b8ed75cfaecac5329cacba9659295c375 (patch)
tree397e5e6c874c602ab52356813f947dc9cf96287a
parent81d8caaf36159bf1accd86eab2e157bf8dd071a9 (diff)
downloaddocker-py-08629f3b8ed75cfaecac5329cacba9659295c375.tar.gz
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 <aleksandar.topuzovic@gmail.com>
-rw-r--r--docker/api/image.py8
1 files 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)