mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-19 21:07:57 +00:00
Fix IOU closing
This commit is contained in:
parent
15f89776d3
commit
018e3c1451
@ -110,8 +110,10 @@ class IOUVM(BaseVM):
|
|||||||
else:
|
else:
|
||||||
self._console = self._manager.port_manager.get_free_console_port()
|
self._console = self._manager.port_manager.get_free_console_port()
|
||||||
|
|
||||||
|
@asyncio.coroutine
|
||||||
def close(self):
|
def close(self):
|
||||||
|
|
||||||
|
yield from self.stop()
|
||||||
if self._console:
|
if self._console:
|
||||||
self._manager.port_manager.release_console_port(self._console)
|
self._manager.port_manager.release_console_port(self._console)
|
||||||
self._console = None
|
self._console = None
|
||||||
@ -498,14 +500,14 @@ class IOUVM(BaseVM):
|
|||||||
Stops the IOU process.
|
Stops the IOU process.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# stop console support
|
|
||||||
if self._ioucon_thread:
|
|
||||||
self._ioucon_thread_stop_event.set()
|
|
||||||
if self._ioucon_thread.is_alive():
|
|
||||||
self._ioucon_thread.join(timeout=3.0) # wait for the thread to free the console port
|
|
||||||
self._ioucon_thread = None
|
|
||||||
|
|
||||||
if self.is_running():
|
if self.is_running():
|
||||||
|
# stop console support
|
||||||
|
if self._ioucon_thread:
|
||||||
|
self._ioucon_thread_stop_event.set()
|
||||||
|
if self._ioucon_thread.is_alive():
|
||||||
|
self._ioucon_thread.join(timeout=3.0) # wait for the thread to free the console port
|
||||||
|
self._ioucon_thread = None
|
||||||
|
|
||||||
self._terminate_process_iou()
|
self._terminate_process_iou()
|
||||||
try:
|
try:
|
||||||
yield from asyncio.wait_for(self._iou_process.wait(), timeout=3)
|
yield from asyncio.wait_for(self._iou_process.wait(), timeout=3)
|
||||||
|
@ -357,6 +357,7 @@ class TelnetServer(Console):
|
|||||||
sock_fd.listen(socket.SOMAXCONN)
|
sock_fd.listen(socket.SOMAXCONN)
|
||||||
self.sock_fd = sock_fd
|
self.sock_fd = sock_fd
|
||||||
log.info("Telnet server ready for connections on {}:{}".format(self.addr, self.port))
|
log.info("Telnet server ready for connections on {}:{}".format(self.addr, self.port))
|
||||||
|
log.info(self.stop_event.is_set())
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ class VPCSVM(BaseVM):
|
|||||||
else:
|
else:
|
||||||
self._console = self._manager.port_manager.get_free_console_port()
|
self._console = self._manager.port_manager.get_free_console_port()
|
||||||
|
|
||||||
|
@asyncio.coroutine
|
||||||
def close(self):
|
def close(self):
|
||||||
|
|
||||||
self._terminate_process()
|
self._terminate_process()
|
||||||
|
Loading…
Reference in New Issue
Block a user