diff options
author | Joffrey F <f.joffrey@gmail.com> | 2014-11-26 12:03:54 -0800 |
---|---|---|
committer | Joffrey F <f.joffrey@gmail.com> | 2014-11-26 12:03:54 -0800 |
commit | 0012430b1bda8a7e16c58366624a733ba63712a8 (patch) | |
tree | df23d20c1de4b4fee9127820e382c218689bdc95 | |
parent | 56afc0598daba38ef0327338b16456794a321ee4 (diff) | |
parent | d8eb04084b6631c1d2b9c864ddcd171a183b6025 (diff) | |
download | docker-py-0012430b1bda8a7e16c58366624a733ba63712a8.tar.gz |
Merge pull request #409 from mattmoor/master
Fix expand_registry_url to be consistent with docker client.
-rw-r--r-- | docker/auth/auth.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/docker/auth/auth.py b/docker/auth/auth.py index c13eed4..cd06cb2 100644 --- a/docker/auth/auth.py +++ b/docker/auth/auth.py @@ -36,13 +36,11 @@ def swap_protocol(url): def expand_registry_url(hostname, insecure=False): if hostname.startswith('http:') or hostname.startswith('https:'): - if '/' not in hostname[9:]: - hostname = hostname + '/v1/' return hostname if utils.ping('https://' + hostname + '/v1/_ping'): - return 'https://' + hostname + '/v1/' + return 'https://' + hostname elif insecure: - return 'http://' + hostname + '/v1/' + return 'http://' + hostname else: raise errors.DockerException( "HTTPS endpoint unresponsive and insecure mode isn't enabled." |