mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-25 00:08:11 +00:00
Remove the workaround for dynamips OSX
This commit is contained in:
parent
def453c116
commit
26a7f83db2
@ -252,19 +252,14 @@ class PortManager:
|
||||
project.record_udp_port(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
|
||||
|
||||
:param port: UDP port number
|
||||
: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:
|
||||
self._used_udp_ports.remove(port)
|
||||
project.remove_udp_port(port)
|
||||
|
@ -365,7 +365,7 @@ class Project:
|
||||
for port in self._used_tcp_ports.copy():
|
||||
port_manager.release_tcp_port(port, self)
|
||||
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
|
||||
def commit(self):
|
||||
|
Loading…
Reference in New Issue
Block a user