diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index 916c2af2..0211e1d9 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -91,13 +91,13 @@ class Controller: user=server_config.get("user", ""), password=server_config.get("password", ""), force=True, - connect=True) # FIXME: not connection for now + connect=False) except ControllerError: log.fatal("Cannot access to the local server, make sure something else is not running on the TCP port {}".format(port)) sys.exit(1) for c in computes: try: - await self.add_compute(**c, connect=False) # FIXME: not connection for now + await self.add_compute(**c, connect=False) except (ControllerError, KeyError): pass # Skip not available servers at loading diff --git a/gns3server/controller/compute.py b/gns3server/controller/compute.py index 892146d9..b4962dab 100644 --- a/gns3server/controller/compute.py +++ b/gns3server/controller/compute.py @@ -501,7 +501,8 @@ class Compute: async def _run_http_query(self, method, path, data=None, timeout=20, raw=False): with async_timeout.timeout(timeout): url = self._getUrl(path) - headers = {'content-type': 'application/json'} + headers = {} + headers['content-type'] = 'application/json' chunked = None if data == {}: data = None diff --git a/tests/controller/test_controller.py b/tests/controller/test_controller.py index d2ecffb4..763f5efb 100644 --- a/tests/controller/test_controller.py +++ b/tests/controller/test_controller.py @@ -295,9 +295,9 @@ async def test_start(controller): "vmname": "GNS3 VM" } - with asyncio_patch("gns3server.controller.compute.Compute.connect") as mock: - await controller.start() - assert mock.called + #with asyncio_patch("gns3server.controller.compute.Compute.connect") as mock: + await controller.start() + #assert mock.called assert len(controller.computes) == 1 # Local compute is created assert controller.computes["local"].name == socket.gethostname()