Support to reset all console connections. Ref https://github.com/GNS3/gns3-server/issues/1619

This commit is contained in:
grossmj committed 2020-07-26 18:27:18 +09:30
1 parent f97d346c34
commit 831ee5f468
17 files changed
+283 -7

No files matched your search

+11
View File
@@ -536,6 +536,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
+11
View File
@@ -1108,6 +1108,17 @@ class Project:
pool.append(node.suspend)
await pool.join()
@open_required
async def reset_console_all(self):
"""
Reset console for all nodes
"""
pool = Pool(concurrency=3)
for node in self.nodes.values():
pool.append(node.reset_console)
await pool.join()
@open_required
async def duplicate_node(self, node, x, y, z):
"""