From a81d2274cd3f5c637fc944d58d86c009001acfcc Mon Sep 17 00:00:00 2001 From: Jeremy Date: Fri, 13 Mar 2015 15:15:27 -0600 Subject: [PATCH] Adds info either the server is started as a local server in VersionHandler response. --- gns3server/handlers/api/version_handler.py | 8 +++++--- gns3server/schemas/version.py | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) 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", } } }