Skip to content

Commit 5df7b31

Browse files
committed
Merge pull request #1050 from docker/1044-fix-login-default
Let server-side determine which serveraddress to use when unspecified
2 parents 3c02fc4 + 50a6a47 commit 5df7b31

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

docker/api/daemon.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ def login(self, username, password=None, email=None, registry=None,
4949
elif not self._auth_configs:
5050
self._auth_configs = auth.load_config()
5151

52-
registry = registry or auth.INDEX_URL
53-
5452
authcfg = auth.resolve_authconfig(self._auth_configs, registry)
5553
# If we found an existing auth config for this registry and username
5654
# combination, we can return it immediately unless reauth is requested.
@@ -67,7 +65,7 @@ def login(self, username, password=None, email=None, registry=None,
6765

6866
response = self._post_json(self._url('/auth'), data=req_data)
6967
if response.status_code == 200:
70-
self._auth_configs[registry] = req_data
68+
self._auth_configs[registry or auth.INDEX_NAME] = req_data
7169
return self._result(response, json=True)
7270

7371
def ping(self):

0 commit comments

Comments
 (0)