Kaydet (Commit) 0e68b0a4 authored tarafından Aanand Prasad's avatar Aanand Prasad

Default to npipe address on Windows

Signed-off-by: 's avatarAanand Prasad <aanand.prasad@gmail.com>
üst 106c08fa
......@@ -36,6 +36,8 @@ from .types import Ulimit, LogConfig
DEFAULT_HTTP_HOST = "127.0.0.1"
DEFAULT_UNIX_SOCKET = "http+unix://var/run/docker.sock"
DEFAULT_NPIPE = 'npipe:////./pipe/docker_engine'
BYTE_UNITS = {
'b': 1,
'k': 1024,
......@@ -390,7 +392,7 @@ def parse_host(addr, is_win32=False, tls=False):
path = ''
if not addr and is_win32:
addr = '{0}:{1}'.format(DEFAULT_HTTP_HOST, 2375)
addr = DEFAULT_NPIPE
if not addr or addr.strip() == 'unix://':
return DEFAULT_UNIX_SOCKET
......
......@@ -419,11 +419,11 @@ class ParseHostTest(base.BaseTestCase):
def test_parse_host_empty_value(self):
unix_socket = 'http+unix://var/run/docker.sock'
tcp_port = 'http://127.0.0.1:2375'
npipe = 'npipe:////./pipe/docker_engine'
for val in [None, '']:
assert parse_host(val, is_win32=False) == unix_socket
assert parse_host(val, is_win32=True) == tcp_port
assert parse_host(val, is_win32=True) == npipe
def test_parse_host_tls(self):
host_value = 'myhost.docker.net:3348'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment