mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix issue when calling reset_console with running VPCS and Qemu nodes. Ref #1619
This commit is contained in:
1 parent
85679aaa94
commit
1148dbc48e
5 files changed
+34
-10
No files matched your search
@@ -386,7 +386,11 @@ class BaseNode:
|
||||
await AsyncioTelnetServer.write_client_intro(writer, echo=True)
|
||||
server = AsyncioTelnetServer(reader=reader, writer=writer, binary=True, echo=True)
|
||||
# warning: this will raise OSError exception if there is a problem...
|
||||
self._wrapper_telnet_server = await asyncio.start_server(server.run, self._manager.port_manager.console_host, self.console)
|
||||
self._wrapper_telnet_server = await asyncio.start_server(
|
||||
server.run,
|
||||
self._manager.port_manager.console_host,
|
||||
self.console
|
||||
)
|
||||
|
||||
async def stop_wrap_console(self):
|
||||
"""
|
||||
@@ -397,14 +401,6 @@ class BaseNode:
|
||||
self._wrapper_telnet_server.close()
|
||||
await self._wrapper_telnet_server.wait_closed()
|
||||
|
||||
async def reset_console(self):
|
||||
"""
|
||||
Reset console
|
||||
"""
|
||||
|
||||
await self.stop_wrap_console()
|
||||
await self.start_wrap_console()
|
||||
|
||||
async def start_websocket_console(self, request):
|
||||
"""
|
||||
Connect to console using Websocket.
|
||||
|
||||
@@ -977,7 +977,6 @@ class Router(BaseNode):
|
||||
raise DynamipsError('"{name}" must be stopped to change the console type to {console_type}'.format(name=self._name,
|
||||
console_type=console_type))
|
||||
|
||||
|
||||
self.console_type = console_type
|
||||
|
||||
if self._console and console_type == "telnet":
|
||||
@@ -993,6 +992,13 @@ class Router(BaseNode):
|
||||
self.aux = aux
|
||||
await self._hypervisor.send('vm set_aux_tcp_port "{name}" {aux}'.format(name=self._name, aux=aux))
|
||||
|
||||
async def reset_console(self):
|
||||
"""
|
||||
Reset console
|
||||
"""
|
||||
|
||||
pass # reset console is not supported with Dynamips
|
||||
|
||||
async def get_cpu_usage(self, cpu_id=0):
|
||||
"""
|
||||
Shows cpu usage in seconds, "cpu_id" is ignored.
|
||||
|
||||
@@ -1567,6 +1567,15 @@ class QemuVM(BaseNode):
|
||||
self._process = None
|
||||
return False
|
||||
|
||||
async def reset_console(self):
|
||||
"""
|
||||
Reset console
|
||||
"""
|
||||
|
||||
await self.stop_wrap_console()
|
||||
if self.is_running():
|
||||
await self.start_wrap_console()
|
||||
|
||||
def command(self):
|
||||
"""
|
||||
Returns the QEMU command line.
|
||||
|
||||
@@ -344,6 +344,15 @@ class VPCSVM(BaseNode):
|
||||
return True
|
||||
return False
|
||||
|
||||
async def reset_console(self):
|
||||
"""
|
||||
Reset console
|
||||
"""
|
||||
|
||||
await self.stop_wrap_console()
|
||||
if self.is_running():
|
||||
await self.start_wrap_console()
|
||||
|
||||
@BaseNode.console_type.setter
|
||||
def console_type(self, new_console_type):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user