Catch exceptions when using AsyncioTelnetServer. Fixes #1321.

This commit is contained in:
grossmj committed 2018-04-16 15:30:06 +08:00
1 parent 025441f027
commit a12c5a95b0
6 files changed
+26 -7

No files matched your search

+4 -1
View File
@@ -848,7 +848,10 @@ class VMwareVM(BaseNode):
writer=self._remote_pipe,
binary=True,
echo=True)
self._telnet_server = yield from asyncio.start_server(server.run, self._manager.port_manager.console_host, self.console)
try:
self._telnet_server = yield from asyncio.start_server(server.run, self._manager.port_manager.console_host, self.console)
except OSError as e:
self.project.emit("log.warning", {"message": "Could not start Telnet server on socket {}:{}: {}".format(self._manager.port_manager.console_host, self.console, e)})
@asyncio.coroutine
def _stop_remote_console(self):