Skip to content

Commit 26531f1

Browse files
committed
Enforce consistent style for push and pull methods
1 parent 38a6651 commit 26531f1

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

docker/client.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -912,15 +912,17 @@ def pull(self, repository, tag=None, stream=False,
912912
else:
913913
headers['X-Registry-Auth'] = auth.encode_header(auth_config)
914914

915-
response = self._post(self._url('/images/create'), params=params,
916-
headers=headers, stream=stream, timeout=None)
915+
response = self._post(
916+
self._url('/images/create'), params=params, headers=headers,
917+
stream=stream, timeout=None
918+
)
917919

918920
self._raise_for_status(response)
919921

920922
if stream:
921923
return self._stream_helper(response)
922-
else:
923-
return self._result(response)
924+
925+
return self._result(response)
924926

925927
def push(self, repository, tag=None, stream=False,
926928
insecure_registry=False):
@@ -948,15 +950,16 @@ def push(self, repository, tag=None, stream=False,
948950
if authcfg:
949951
headers['X-Registry-Auth'] = auth.encode_header(authcfg)
950952

951-
response = self._post_json(u, None, headers=headers,
952-
stream=stream, params=params)
953-
else:
954-
response = self._post_json(u, None, stream=stream, params=params)
953+
response = self._post_json(
954+
u, None, headers=headers, stream=stream, params=params
955+
)
955956

956957
self._raise_for_status(response)
957958

958-
return stream and self._stream_helper(response) \
959-
or self._result(response)
959+
if stream:
960+
return self._stream_helper(response)
961+
962+
return self._result(response)
960963

961964
@check_resource
962965
def remove_container(self, container, v=False, link=False, force=False):

0 commit comments

Comments
 (0)