mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-22 14:12:29 +00:00
Merge pull request #1228 from GNS3/es-console
Close telnet console after stopping the node. Ref gui/#2330
This commit is contained in:
commit
642536a070
@ -166,8 +166,8 @@ class EthernetSwitch(Device):
|
|||||||
|
|
||||||
self._telnet_shell = EthernetSwitchConsole(self)
|
self._telnet_shell = EthernetSwitchConsole(self)
|
||||||
self._telnet_shell.prompt = self._name + '> '
|
self._telnet_shell.prompt = self._name + '> '
|
||||||
telnet = create_telnet_shell(self._telnet_shell)
|
self._telnet = create_telnet_shell(self._telnet_shell)
|
||||||
self._telnet_server = (yield from asyncio.start_server(telnet.run, self._manager.port_manager.console_host, self.console))
|
self._telnet_server = (yield from asyncio.start_server(self._telnet.run, self._manager.port_manager.console_host, self.console))
|
||||||
|
|
||||||
self._hypervisor.devices.append(self)
|
self._hypervisor.devices.append(self)
|
||||||
|
|
||||||
@ -214,6 +214,8 @@ class EthernetSwitch(Device):
|
|||||||
"""
|
"""
|
||||||
Deletes this Ethernet switch.
|
Deletes this Ethernet switch.
|
||||||
"""
|
"""
|
||||||
|
yield from self._telnet.close()
|
||||||
|
self._telnet_server.close()
|
||||||
|
|
||||||
for nio in self._nios.values():
|
for nio in self._nios.values():
|
||||||
if nio:
|
if nio:
|
||||||
|
@ -209,6 +209,12 @@ class AsyncioTelnetServer:
|
|||||||
yield from connection.disconnected()
|
yield from connection.disconnected()
|
||||||
del self._connections[network_writer]
|
del self._connections[network_writer]
|
||||||
|
|
||||||
|
@asyncio.coroutine
|
||||||
|
def close(self):
|
||||||
|
for writer, connection in self._connections.items():
|
||||||
|
writer.write_eof()
|
||||||
|
yield from writer.drain()
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def client_connected_hook(self):
|
def client_connected_hook(self):
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user