Skip to content

Commit 08629f3

Browse files
committed
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 <[email protected]>
1 parent 81d8caa commit 08629f3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docker/api/image.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def load_image(self, data):
148148
self._raise_for_status(res)
149149

150150
def pull(self, repository, tag=None, stream=False,
151-
insecure_registry=False, auth_config=None):
151+
insecure_registry=False, auth_config=None, decode=False):
152152
if insecure_registry:
153153
warnings.warn(
154154
INSECURE_REGISTRY_DEPRECATION_WARNING.format('pull()'),
@@ -200,12 +200,12 @@ def pull(self, repository, tag=None, stream=False,
200200
self._raise_for_status(response)
201201

202202
if stream:
203-
return self._stream_helper(response)
203+
return self._stream_helper(response, decode=decode)
204204

205205
return self._result(response)
206206

207207
def push(self, repository, tag=None, stream=False,
208-
insecure_registry=False):
208+
insecure_registry=False, decode=False):
209209
if insecure_registry:
210210
warnings.warn(
211211
INSECURE_REGISTRY_DEPRECATION_WARNING.format('push()'),
@@ -241,7 +241,7 @@ def push(self, repository, tag=None, stream=False,
241241
self._raise_for_status(response)
242242

243243
if stream:
244-
return self._stream_helper(response)
244+
return self._stream_helper(response, decode=decode)
245245

246246
return self._result(response)
247247

0 commit comments

Comments
 (0)