mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-12 17:10:55 +00:00
Do not send warnings back to the GUI when a console port not in range or is already taken.
This commit is contained in:
parent
f1737a6e43
commit
ec6e5a6118
@ -225,15 +225,15 @@ class PortManager:
|
|||||||
old_port = port
|
old_port = port
|
||||||
port = self.get_free_tcp_port(project, port_range_start=port_range_start, port_range_end=port_range_end)
|
port = self.get_free_tcp_port(project, port_range_start=port_range_start, port_range_end=port_range_end)
|
||||||
msg = "TCP port {} already in use on host {}. Port has been replaced by {}".format(old_port, self._console_host, port)
|
msg = "TCP port {} already in use on host {}. Port has been replaced by {}".format(old_port, self._console_host, port)
|
||||||
log.warning(msg)
|
log.debug(msg)
|
||||||
project.emit("log.warning", {"message": msg})
|
#project.emit("log.warning", {"message": msg})
|
||||||
return port
|
return port
|
||||||
if port < port_range_start or port > port_range_end:
|
if port < port_range_start or port > port_range_end:
|
||||||
old_port = port
|
old_port = port
|
||||||
port = self.get_free_tcp_port(project, port_range_start=port_range_start, port_range_end=port_range_end)
|
port = self.get_free_tcp_port(project, port_range_start=port_range_start, port_range_end=port_range_end)
|
||||||
msg = "TCP port {} is outside the range {}-{} on host {}. Port has been replaced by {}".format(old_port, port_range_start, port_range_end, self._console_host, port)
|
msg = "TCP port {} is outside the range {}-{} on host {}. Port has been replaced by {}".format(old_port, port_range_start, port_range_end, self._console_host, port)
|
||||||
log.warning(msg)
|
log.debug(msg)
|
||||||
project.emit("log.warning", {"message": msg})
|
#project.emit("log.warning", {"message": msg})
|
||||||
return port
|
return port
|
||||||
try:
|
try:
|
||||||
PortManager._check_port(self._console_host, port, "TCP")
|
PortManager._check_port(self._console_host, port, "TCP")
|
||||||
@ -241,8 +241,8 @@ class PortManager:
|
|||||||
old_port = port
|
old_port = port
|
||||||
port = self.get_free_tcp_port(project, port_range_start=port_range_start, port_range_end=port_range_end)
|
port = self.get_free_tcp_port(project, port_range_start=port_range_start, port_range_end=port_range_end)
|
||||||
msg = "TCP port {} already in use on host {}. Port has been replaced by {}".format(old_port, self._console_host, port)
|
msg = "TCP port {} already in use on host {}. Port has been replaced by {}".format(old_port, self._console_host, port)
|
||||||
log.warning(msg)
|
log.debug(msg)
|
||||||
project.emit("log.warning", {"message": msg})
|
#project.emit("log.warning", {"message": msg})
|
||||||
return port
|
return port
|
||||||
|
|
||||||
self._used_tcp_ports.add(port)
|
self._used_tcp_ports.add(port)
|
||||||
|
Loading…
Reference in New Issue
Block a user