If listen on all interface do not return localhost as console

Fix https://github.com/GNS3/gns3-gui/issues/1574
This commit is contained in:
Julien Duponchelle committed 2016-10-17 18:20:29 +02:00
1 parent f737989e44
commit a8ffaa9cb5
3 files changed
+19 -3

No files matched your search

+10 -2
View File
@@ -411,8 +411,16 @@ class Compute:
def _getUrl(self, path):
host = self._host
# IPV6
if host and ":" in host:
host = "[{}]".format(host)
if host:
# IPV6
if ":" in host:
# Reduce IPV6 to his simple form
host = str(ipaddress.IPv6Address(host))
if host == "::":
host = "::1"
host = "[{}]".format(host)
elif host == "0.0.0.0":
host = "127.0.0.1"
return "{}://{}:{}/v2/compute{}".format(self._protocol, host, self._port, path)
@asyncio.coroutine
+1 -1
View File
@@ -127,7 +127,7 @@ NODE_OBJECT_SCHEMA = {
"type": ["integer", "null"]
},
"console_host": {
"description": "Console host",
"description": "Console host. Warning if the host is 0.0.0.0 or :: (listen on all interfaces) you need to use the same address you use to connect to the controller.",
"type": "string",
"minLength": 1,
},