mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-01 04:38:12 +00:00
Raise an error if you try to use Docker on non Linux host
This commit is contained in:
parent
d1de665939
commit
42ff398f05
@ -49,8 +49,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):
|
||||||
|
Loading…
Reference in New Issue
Block a user