From 7e91a5cb11fc60c70ba1a08a6c1a80ccb993b5dd Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Fri, 8 Jul 2016 11:17:17 +0200 Subject: [PATCH] Raise error if not started with --local If you try to use a local server but you don't have started it with --local we raise an error. --- gns3server/controller/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index 5ec53510..8be50bb3 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -201,6 +201,9 @@ class Controller: try: return self._computes[compute_id] except KeyError: + server_config = Config.instance().get_section_config("Server") + if compute_id == "local" and server_config.getboolean("local", False) is False: + raise aiohttp.web.HTTPNotFound(text="You try to use a node on the local server but the controller is not started with --local") raise aiohttp.web.HTTPNotFound(text="Compute ID {} doesn't exist".format(compute_id)) @asyncio.coroutine