mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-06-14 13:28:12 +00:00
Support to reset all console connections. Ref https://github.com/GNS3/gns3-server/issues/1619
This commit is contained in:
@ -539,6 +539,17 @@ class Node:
|
||||
except asyncio.TimeoutError:
|
||||
raise aiohttp.web.HTTPRequestTimeout(text="Timeout when reloading {}".format(self._name))
|
||||
|
||||
async def reset_console(self):
|
||||
"""
|
||||
Reset the console
|
||||
"""
|
||||
|
||||
if self._console and self._console_type == "telnet":
|
||||
try:
|
||||
await self.post("/console/reset", timeout=240)
|
||||
except asyncio.TimeoutError:
|
||||
raise aiohttp.web.HTTPRequestTimeout(text="Timeout when reset console {}".format(self._name))
|
||||
|
||||
async def post(self, path, data=None, **kwargs):
|
||||
"""
|
||||
HTTP post on the node
|
||||
|
Reference in New Issue
Block a user