1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Remove the workaround for dynamips OSX

This commit is contained in:
Julien Duponchelle 2015-04-15 15:58:31 +02:00
parent def453c116
commit 26a7f83db2
2 changed files with 2 additions and 7 deletions

View File

@ -252,19 +252,14 @@ class PortManager:
project.record_udp_port(port) project.record_udp_port(port)
log.debug("UDP port {} has been reserved".format(port)) log.debug("UDP port {} has been reserved".format(port))
def release_udp_port(self, port, project, force_remove=False): def release_udp_port(self, port, project):
""" """
Release a specific UDP port number Release a specific UDP port number
:param port: UDP port number :param port: UDP port number
:param project: Project instance :param project: Project instance
:param force_remove: Force port removal even on Darwnin
""" """
# A bug with Dynamips on Darwin which doesn't correctly free UDP ports, they are freed only when changing the project
if sys.platform.startswith("darwin") and force_remove is False:
return
if port in self._used_udp_ports: if port in self._used_udp_ports:
self._used_udp_ports.remove(port) self._used_udp_ports.remove(port)
project.remove_udp_port(port) project.remove_udp_port(port)

View File

@ -365,7 +365,7 @@ class Project:
for port in self._used_tcp_ports.copy(): for port in self._used_tcp_ports.copy():
port_manager.release_tcp_port(port, self) port_manager.release_tcp_port(port, self)
for port in self._used_udp_ports.copy(): for port in self._used_udp_ports.copy():
port_manager.release_udp_port(port, self, force_remove=True) port_manager.release_udp_port(port, self)
@asyncio.coroutine @asyncio.coroutine
def commit(self): def commit(self):