1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Fixes VPCS process termination.

This commit is contained in:
grossmj 2015-04-26 12:57:06 -06:00
parent da2b895c99
commit 3e6996903f

View File

@ -27,6 +27,7 @@ import signal
import re import re
import asyncio import asyncio
import shutil import shutil
import gns3server.utils.asyncio
from pkg_resources import parse_version from pkg_resources import parse_version
from .vpcs_error import VPCSError from .vpcs_error import VPCSError
@ -247,12 +248,13 @@ class VPCSVM(BaseVM):
if self.is_running(): if self.is_running():
self._terminate_process() self._terminate_process()
try: if self._process.returncode is None:
yield from asyncio.wait_for(self._process.wait(), timeout=3) try:
except asyncio.TimeoutError: yield from gns3server.utils.asyncio.wait_for_process_termination(self._process, timeout=3)
if self._process.returncode is None: except asyncio.TimeoutError:
log.warn("VPCS process {} is still running... killing it".format(self._process.pid)) if self._process.returncode is None:
self._process.kill() log.warn("VPCS process {} is still running... killing it".format(self._process.pid))
self._process.kill()
self._process = None self._process = None
self._started = False self._started = False