diff options
| author | Aanand Prasad <aanand.prasad@gmail.com> | 2015-08-31 18:07:07 -0700 |
|---|---|---|
| committer | Aanand Prasad <aanand.prasad@gmail.com> | 2015-09-01 16:28:05 -0700 |
| commit | 1362938f03b2eca3edb0682b5ea48c841dc636c5 (patch) | |
| tree | 84da679914a15bbdeab69fcb7447726a5ef6f12e /docker/utils/utils.py | |
| parent | 33acb9d2e05d0f3abb7897abbe50dd54600da85b (diff) | |
| download | docker-py-1362938f03b2eca3edb0682b5ea48c841dc636c5.tar.gz | |
Default to 127.0.0.1:2375 on Windows
Following the logic of the Docker client.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Diffstat (limited to 'docker/utils/utils.py')
| -rw-r--r-- | docker/utils/utils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py index 8dc726b..57864cf 100644 --- a/docker/utils/utils.py +++ b/docker/utils/utils.py @@ -272,11 +272,15 @@ def parse_repository_tag(repo): # fd:// protocol unsupported (for obvious reasons) # Added support for http and https # Protocol translation: tcp -> http, unix -> http+unix -def parse_host(addr): +def parse_host(addr, platform=None): proto = "http+unix" host = DEFAULT_HTTP_HOST port = None path = '' + + if not addr and platform == 'win32': + addr = '{0}:{1}'.format(DEFAULT_HTTP_HOST, 2375) + if not addr or addr.strip() == 'unix://': return DEFAULT_UNIX_SOCKET |
