Fix ProcessLookupError on _checkAlive Qemu

Fix #308
This commit is contained in:
Julien Duponchelle 2015-09-11 14:16:56 +02:00
parent cc7fe1a477
commit 22e4fec2e2

View File

@ -907,7 +907,10 @@ class QemuVM(BaseVM):
self._process.terminate() self._process.terminate()
yield from gns3server.utils.asyncio.wait_for_process_termination(self._process, timeout=3) yield from gns3server.utils.asyncio.wait_for_process_termination(self._process, timeout=3)
except asyncio.TimeoutError: except asyncio.TimeoutError:
try:
self._process.kill() self._process.kill()
except ProcessLookupError:
pass
if self._process.returncode is None: if self._process.returncode is None:
log.warn('QEMU VM "{}" PID={} is still running'.format(self._name, self._process.pid)) log.warn('QEMU VM "{}" PID={} is still running'.format(self._name, self._process.pid))
self._process = None self._process = None