From 897455d5e98dc672e9c65854fdecd559ae44252e Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 22 Aug 2016 18:49:25 +0200 Subject: [PATCH] Return computer name instead of local. It's more logic when using remote controller --- gns3server/controller/__init__.py | 15 +++++++-------- gns3server/controller/compute.py | 3 ++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index 4a9ce7f0..55de3582 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -51,14 +51,13 @@ class Controller: self._config_file = os.path.join(config_path, "gns3_controller.conf") server_config = Config.instance().get_section_config("Server") - if server_config.getboolean("local", False) is True: - self._computes["local"] = Compute(compute_id="local", - controller=self, - protocol=server_config.get("protocol", "http"), - host=server_config.get("host", "localhost"), - port=server_config.getint("port", 3080), - user=server_config.get("user", ""), - password=server_config.get("password", "")) + self._computes["local"] = Compute(compute_id="local", + controller=self, + protocol=server_config.get("protocol", "http"), + host=server_config.get("host", "localhost"), + port=server_config.getint("port", 3080), + user=server_config.get("user", ""), + password=server_config.get("password", "")) def save(self): """ diff --git a/gns3server/controller/compute.py b/gns3server/controller/compute.py index 0696c25f..b7893c06 100644 --- a/gns3server/controller/compute.py +++ b/gns3server/controller/compute.py @@ -17,6 +17,7 @@ import aiohttp import asyncio +import socket import json import uuid import os @@ -163,7 +164,7 @@ class Compute: if name is not None: self._name = name elif self._id == "local": - self._name = "Local" + self._name = socket.gethostname() else: if self._user: user = self._user