1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-25 01:38: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,8 +248,9 @@ class VPCSVM(BaseVM):
if self.is_running(): if self.is_running():
self._terminate_process() self._terminate_process()
if self._process.returncode is None:
try: try:
yield from asyncio.wait_for(self._process.wait(), timeout=3) yield from gns3server.utils.asyncio.wait_for_process_termination(self._process, timeout=3)
except asyncio.TimeoutError: except asyncio.TimeoutError:
if self._process.returncode is None: if self._process.returncode is None:
log.warn("VPCS process {} is still running... killing it".format(self._process.pid)) log.warn("VPCS process {} is still running... killing it".format(self._process.pid))