mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
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.
This commit is contained in:
parent
05df0a9bb6
commit
7e91a5cb11
@ -201,6 +201,9 @@ class Controller:
|
|||||||
try:
|
try:
|
||||||
return self._computes[compute_id]
|
return self._computes[compute_id]
|
||||||
except KeyError:
|
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))
|
raise aiohttp.web.HTTPNotFound(text="Compute ID {} doesn't exist".format(compute_id))
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
Loading…
Reference in New Issue
Block a user