1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Adds info either the server is started as a local server in VersionHandler response.

This commit is contained in:
Jeremy 2015-03-13 15:15:27 -06:00
parent 221befa73e
commit a81d2274cd
2 changed files with 9 additions and 3 deletions

View File

@ -16,12 +16,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from ...web.route import Route from ...web.route import Route
from ...config import Config
from ...schemas.version import VERSION_SCHEMA from ...schemas.version import VERSION_SCHEMA
from ...version import __version__ from ...version import __version__
from aiohttp.web import HTTPConflict from aiohttp.web import HTTPConflict
import asyncio
class VersionHandler: class VersionHandler:
@ -31,7 +30,10 @@ class VersionHandler:
description="Retrieve the server version number", description="Retrieve the server version number",
output=VERSION_SCHEMA) output=VERSION_SCHEMA)
def version(request, response): 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 @classmethod
@Route.post( @Route.post(

View File

@ -24,6 +24,10 @@ VERSION_SCHEMA = {
"version": { "version": {
"description": "Version number human readable", "description": "Version number human readable",
"type": "string", "type": "string",
},
"local": {
"description": "Either this is a local server",
"type": "boolean",
} }
} }
} }