diff options
author | Marko Mikulicic <mkm@cesanta.com> | 2015-05-29 00:58:49 +0200 |
---|---|---|
committer | Marko Mikulicic <mkm@cesanta.com> | 2015-05-29 00:58:49 +0200 |
commit | e96ebf8c98579b1429b59aaaffc851675162eea1 (patch) | |
tree | 5098c938d710acd25d75d3675565cdfdd44a38d5 | |
parent | be73aaf5401faf5ca64911fb6664036c7b7ec61b (diff) | |
download | docker-py-e96ebf8c98579b1429b59aaaffc851675162eea1.tar.gz |
Fix pinging an unauthenticated v2 registry
-rw-r--r-- | docker/utils/utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py index e4a3c9e..b2834ad 100644 --- a/docker/utils/utils.py +++ b/docker/utils/utils.py @@ -129,7 +129,9 @@ def ping(url): except Exception: return False else: - return res.status_code < 400 + # We don't send yet auth headers + # and a v2 registry will respond with status 401 + return res.status_code == 401 or res.status_code < 400 def _convert_port_binding(binding): |