Merge branch '1.5' into 2.0

This commit is contained in:
Julien Duponchelle 2016-06-21 09:58:28 +02:00
commit 32252e5193
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -48,8 +48,11 @@ class Docker(BaseManager):
@asyncio.coroutine @asyncio.coroutine
def connector(self): def connector(self):
if not self._connected or self._connector.closed: if not self._connected or self._connector.closed:
if not sys.platform.startswith("linux"):
raise DockerError("Docker is supported only on Linux")
try: try:
self._connector = aiohttp.connector.UnixConnector(self._server_url) self._connector = aiohttp.connector.UnixConnector(self._server_url, conn_timeout=2)
self._connected = True self._connected = True
version = yield from self.query("GET", "version") version = yield from self.query("GET", "version")
except (aiohttp.errors.ClientOSError, FileNotFoundError): except (aiohttp.errors.ClientOSError, FileNotFoundError):