diff options
author | Joffrey F <joffrey@docker.com> | 2016-01-28 16:25:23 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2016-01-28 16:25:23 -0800 |
commit | bb94fe7a8c83b82050c8971464c2838d335b41a4 (patch) | |
tree | 497ca19797bc2bc2740aeb1473e4068db6ed0696 /docker/utils/utils.py | |
parent | 446e6d08dd569194a27bb354a184b7d94ecf5e48 (diff) | |
download | docker-py-894-docker_host_env.tar.gz |
Support unspecified protocol in base_url when using TLS894-docker_host_env
(assume HTTPS)
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/utils/utils.py')
-rw-r--r-- | docker/utils/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py index 1ce1867..dc46f1e 100644 --- a/docker/utils/utils.py +++ b/docker/utils/utils.py @@ -345,7 +345,7 @@ def parse_repository_tag(repo_name): # fd:// protocol unsupported (for obvious reasons) # Added support for http and https # Protocol translation: tcp -> http, unix -> http+unix -def parse_host(addr, platform=None): +def parse_host(addr, platform=None, tls=False): proto = "http+unix" host = DEFAULT_HTTP_HOST port = None @@ -381,7 +381,7 @@ def parse_host(addr, platform=None): raise errors.DockerException( "Invalid bind address protocol: {0}".format(addr) ) - proto = "http" + proto = "https" if tls else "http" if proto != "http+unix" and ":" in addr: host_parts = addr.split(':') |