mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Return computer name instead of local. It's more logic when using remote controller
This commit is contained in:
parent
46910a183e
commit
897455d5e9
@ -51,7 +51,6 @@ class Controller:
|
|||||||
self._config_file = os.path.join(config_path, "gns3_controller.conf")
|
self._config_file = os.path.join(config_path, "gns3_controller.conf")
|
||||||
|
|
||||||
server_config = Config.instance().get_section_config("Server")
|
server_config = Config.instance().get_section_config("Server")
|
||||||
if server_config.getboolean("local", False) is True:
|
|
||||||
self._computes["local"] = Compute(compute_id="local",
|
self._computes["local"] = Compute(compute_id="local",
|
||||||
controller=self,
|
controller=self,
|
||||||
protocol=server_config.get("protocol", "http"),
|
protocol=server_config.get("protocol", "http"),
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import socket
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
import os
|
import os
|
||||||
@ -163,7 +164,7 @@ class Compute:
|
|||||||
if name is not None:
|
if name is not None:
|
||||||
self._name = name
|
self._name = name
|
||||||
elif self._id == "local":
|
elif self._id == "local":
|
||||||
self._name = "Local"
|
self._name = socket.gethostname()
|
||||||
else:
|
else:
|
||||||
if self._user:
|
if self._user:
|
||||||
user = self._user
|
user = self._user
|
||||||
|
Loading…
Reference in New Issue
Block a user