diff --git a/gns3server/handlers/api/version_handler.py b/gns3server/handlers/api/version_handler.py index 930c733e..10dc138a 100644 --- a/gns3server/handlers/api/version_handler.py +++ b/gns3server/handlers/api/version_handler.py @@ -16,12 +16,11 @@ # along with this program. If not, see . from ...web.route import Route +from ...config import Config from ...schemas.version import VERSION_SCHEMA from ...version import __version__ from aiohttp.web import HTTPConflict -import asyncio - class VersionHandler: @@ -31,7 +30,10 @@ class VersionHandler: description="Retrieve the server version number", output=VERSION_SCHEMA) def version(request, response): - response.json({"version": __version__}) + + config = Config.instance() + local_server =config.get_section_config("Server").getboolean("local", False) + response.json({"version": __version__, "local": local_server}) @classmethod @Route.post( diff --git a/gns3server/schemas/version.py b/gns3server/schemas/version.py index 127084df..95e08507 100644 --- a/gns3server/schemas/version.py +++ b/gns3server/schemas/version.py @@ -24,6 +24,10 @@ VERSION_SCHEMA = { "version": { "description": "Version number human readable", "type": "string", + }, + "local": { + "description": "Either this is a local server", + "type": "boolean", } } }