Kaydet (Commit) 08629f3b authored tarafından Aleksandar Topuzovic's avatar Aleksandar Topuzovic

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: 's avatarAleksandar Topuzovic <aleksandar.topuzovic@gmail.com>
üst 81d8caaf
...@@ -148,7 +148,7 @@ class ImageApiMixin(object): ...@@ -148,7 +148,7 @@ class ImageApiMixin(object):
self._raise_for_status(res) self._raise_for_status(res)
def pull(self, repository, tag=None, stream=False, 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: if insecure_registry:
warnings.warn( warnings.warn(
INSECURE_REGISTRY_DEPRECATION_WARNING.format('pull()'), INSECURE_REGISTRY_DEPRECATION_WARNING.format('pull()'),
...@@ -200,12 +200,12 @@ class ImageApiMixin(object): ...@@ -200,12 +200,12 @@ class ImageApiMixin(object):
self._raise_for_status(response) self._raise_for_status(response)
if stream: if stream:
return self._stream_helper(response) return self._stream_helper(response, decode=decode)
return self._result(response) return self._result(response)
def push(self, repository, tag=None, stream=False, def push(self, repository, tag=None, stream=False,
insecure_registry=False): insecure_registry=False, decode=False):
if insecure_registry: if insecure_registry:
warnings.warn( warnings.warn(
INSECURE_REGISTRY_DEPRECATION_WARNING.format('push()'), INSECURE_REGISTRY_DEPRECATION_WARNING.format('push()'),
...@@ -241,7 +241,7 @@ class ImageApiMixin(object): ...@@ -241,7 +241,7 @@ class ImageApiMixin(object):
self._raise_for_status(response) self._raise_for_status(response)
if stream: if stream:
return self._stream_helper(response) return self._stream_helper(response, decode=decode)
return self._result(response) return self._result(response)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment