1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-25 00:08:11 +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:
grossmj 2016-04-07 14:42:52 -06:00
parent f1737a6e43
commit ec6e5a6118

View File

@ -225,15 +225,15 @@ class PortManager:
old_port = port
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)
log.warning(msg)
project.emit("log.warning", {"message": msg})
log.debug(msg)
#project.emit("log.warning", {"message": msg})
return port
if port < port_range_start or port > port_range_end:
old_port = port
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)
log.warning(msg)
project.emit("log.warning", {"message": msg})
log.debug(msg)
#project.emit("log.warning", {"message": msg})
return port
try:
PortManager._check_port(self._console_host, port, "TCP")
@ -241,8 +241,8 @@ class PortManager:
old_port = port
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)
log.warning(msg)
project.emit("log.warning", {"message": msg})
log.debug(msg)
#project.emit("log.warning", {"message": msg})
return port
self._used_tcp_ports.add(port)