mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Support to reset links. Fixes https://github.com/GNS3/gns3-server/issues/1620
This commit is contained in:
1 parent
cbcdaabcce
commit
f97d346c34
4 files changed
+51
-2
No files matched your search
@@ -305,6 +305,13 @@ class Link:
|
||||
n["port"].link = None
|
||||
n["node"].remove_link(self)
|
||||
|
||||
async def reset(self):
|
||||
"""
|
||||
Reset a link
|
||||
"""
|
||||
|
||||
raise NotImplementedError
|
||||
|
||||
async def start_capture(self, data_link_type="DLT_EN10MB", capture_file_name=None):
|
||||
"""
|
||||
Start capture on the link
|
||||
|
||||
@@ -141,7 +141,7 @@ class UDPLink(Link):
|
||||
return
|
||||
try:
|
||||
await node1.delete("/adapters/{adapter_number}/ports/{port_number}/nio".format(adapter_number=adapter_number1, port_number=port_number1), timeout=120)
|
||||
# If the node is already delete (user selected multiple element and delete all in the same time)
|
||||
# If the node is already deleted (user selected multiple element and delete all in the same time)
|
||||
except aiohttp.web.HTTPNotFound:
|
||||
pass
|
||||
|
||||
@@ -153,11 +153,20 @@ class UDPLink(Link):
|
||||
return
|
||||
try:
|
||||
await node2.delete("/adapters/{adapter_number}/ports/{port_number}/nio".format(adapter_number=adapter_number2, port_number=port_number2), timeout=120)
|
||||
# If the node is already delete (user selected multiple element and delete all in the same time)
|
||||
# If the node is already deleted (user selected multiple element and delete all in the same time)
|
||||
except aiohttp.web.HTTPNotFound:
|
||||
pass
|
||||
await super().delete()
|
||||
|
||||
async def reset(self):
|
||||
"""
|
||||
Reset the link.
|
||||
"""
|
||||
|
||||
# recreate the link on the compute
|
||||
await self.delete()
|
||||
await self.create()
|
||||
|
||||
async def start_capture(self, data_link_type="DLT_EN10MB", capture_file_name=None):
|
||||
"""
|
||||
Start capture on a link
|
||||
|
||||
Reference in new issue
Block a user