From 3e6996903f039db477603c17fc9260be6c655386 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sun, 26 Apr 2015 12:57:06 -0600 Subject: [PATCH] Fixes VPCS process termination. --- gns3server/modules/vpcs/vpcs_vm.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gns3server/modules/vpcs/vpcs_vm.py b/gns3server/modules/vpcs/vpcs_vm.py index b96810bb..02d7f15d 100644 --- a/gns3server/modules/vpcs/vpcs_vm.py +++ b/gns3server/modules/vpcs/vpcs_vm.py @@ -27,6 +27,7 @@ import signal import re import asyncio import shutil +import gns3server.utils.asyncio from pkg_resources import parse_version from .vpcs_error import VPCSError @@ -247,12 +248,13 @@ class VPCSVM(BaseVM): if self.is_running(): self._terminate_process() - try: - yield from asyncio.wait_for(self._process.wait(), timeout=3) - except asyncio.TimeoutError: - if self._process.returncode is None: - log.warn("VPCS process {} is still running... killing it".format(self._process.pid)) - self._process.kill() + if self._process.returncode is None: + try: + yield from gns3server.utils.asyncio.wait_for_process_termination(self._process, timeout=3) + except asyncio.TimeoutError: + if self._process.returncode is None: + log.warn("VPCS process {} is still running... killing it".format(self._process.pid)) + self._process.kill() self._process = None self._started = False