mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-20 05:17:56 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
a929dfea38
@ -40,7 +40,7 @@ class CrashReport:
|
|||||||
Report crash to a third party service
|
Report crash to a third party service
|
||||||
"""
|
"""
|
||||||
|
|
||||||
DSN = "sync+https://22979234ab4749ceabce08e6da4c1476:1432c8c7a43d410b9b5bb33f8e55b2a6@app.getsentry.com/38482"
|
DSN = "sync+https://45147533567b4d529ca09c093758681f:12d8b456cdb34d23aba771325aa64ee6@app.getsentry.com/38482"
|
||||||
if hasattr(sys, "frozen"):
|
if hasattr(sys, "frozen"):
|
||||||
cacert = os.path.join(os.getcwd(), "cacert.pem")
|
cacert = os.path.join(os.getcwd(), "cacert.pem")
|
||||||
if os.path.isfile(cacert):
|
if os.path.isfile(cacert):
|
||||||
|
@ -140,7 +140,7 @@ class PortManager:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if end_port < start_port:
|
if end_port < start_port:
|
||||||
raise Exception("Invalid port range {}-{}".format(start_port, end_port))
|
raise HTTPConflict(text="Invalid port range {}-{}".format(start_port, end_port))
|
||||||
|
|
||||||
if socket_type == "UDP":
|
if socket_type == "UDP":
|
||||||
socket_type = socket.SOCK_DGRAM
|
socket_type = socket.SOCK_DGRAM
|
||||||
|
@ -152,7 +152,7 @@ class Project:
|
|||||||
try:
|
try:
|
||||||
shutil.rmtree(old_path)
|
shutil.rmtree(old_path)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise aiohttp.web.HTTPConflict("Can't remove temporary directory {}: {}".format(old_path, e))
|
raise aiohttp.web.HTTPConflict(text="Can't remove temporary directory {}: {}".format(old_path, e))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
@ -45,3 +45,13 @@ def test_release_udp_port():
|
|||||||
pm.reserve_udp_port(4242, project)
|
pm.reserve_udp_port(4242, project)
|
||||||
pm.release_udp_port(4242, project)
|
pm.release_udp_port(4242, project)
|
||||||
pm.reserve_udp_port(4242, project)
|
pm.reserve_udp_port(4242, project)
|
||||||
|
|
||||||
|
|
||||||
|
def test_find_unused_port():
|
||||||
|
p = PortManager().find_unused_port(1000, 10000)
|
||||||
|
assert p is not None
|
||||||
|
|
||||||
|
|
||||||
|
def test_find_unused_port_invalid_range():
|
||||||
|
with pytest.raises(aiohttp.web.HTTPConflict):
|
||||||
|
p = PortManager().find_unused_port(10000, 1000)
|
||||||
|
Loading…
Reference in New Issue
Block a user