From 42ff398f05d7ed4e656bbc8102ca9837d9082067 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 21 Jun 2016 09:57:47 +0200 Subject: [PATCH] Raise an error if you try to use Docker on non Linux host --- gns3server/modules/docker/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/modules/docker/__init__.py b/gns3server/modules/docker/__init__.py index 1c3779a7..f0aaa2e9 100644 --- a/gns3server/modules/docker/__init__.py +++ b/gns3server/modules/docker/__init__.py @@ -49,8 +49,11 @@ class Docker(BaseManager): @asyncio.coroutine def connector(self): if not self._connected or self._connector.closed: + if not sys.platform.startswith("linux"): + raise DockerError("Docker is supported only on Linux") + try: - self._connector = aiohttp.connector.UnixConnector(self._server_url) + self._connector = aiohttp.connector.UnixConnector(self._server_url, conn_timeout=2) self._connected = True version = yield from self.query("GET", "version") except (aiohttp.errors.ClientOSError, FileNotFoundError):