mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-12 09:00:57 +00:00
Fixes how to test if iou and iouyap are running.
This commit is contained in:
parent
980e63e667
commit
07067d6765
@ -597,10 +597,9 @@ class IOUVM(BaseVM):
|
||||
if self._iou_process.returncode is None:
|
||||
log.warn("IOU process {} is still running... killing it".format(self._iou_process.pid))
|
||||
self._iou_process.kill()
|
||||
|
||||
self._iou_process = None
|
||||
|
||||
if self._iouyap_process is not None:
|
||||
if self.is_iouyap_running():
|
||||
self._terminate_process_iouyap()
|
||||
try:
|
||||
yield from gns3server.utils.asyncio.wait_for_process_termination(self._iouyap_process, timeout=3)
|
||||
@ -608,14 +607,13 @@ class IOUVM(BaseVM):
|
||||
if self._iouyap_process.returncode is None:
|
||||
log.warn("IOUYAP process {} is still running... killing it".format(self._iouyap_process.pid))
|
||||
self._iouyap_process.kill()
|
||||
|
||||
self._iouyap_process = None
|
||||
|
||||
self._started = False
|
||||
|
||||
def _terminate_process_iouyap(self):
|
||||
"""Terminate the process if running"""
|
||||
|
||||
if self._iouyap_process:
|
||||
log.info("Stopping IOUYAP instance {} PID={}".format(self.name, self._iouyap_process.pid))
|
||||
try:
|
||||
self._iouyap_process.terminate()
|
||||
@ -626,7 +624,6 @@ class IOUVM(BaseVM):
|
||||
def _terminate_process_iou(self):
|
||||
"""Terminate the process if running"""
|
||||
|
||||
if self._iou_process:
|
||||
log.info("Stopping IOU instance {} PID={}".format(self.name, self._iou_process.pid))
|
||||
try:
|
||||
self._iou_process.terminate()
|
||||
@ -650,7 +647,7 @@ class IOUVM(BaseVM):
|
||||
:returns: True or False
|
||||
"""
|
||||
|
||||
if self._iou_process:
|
||||
if self._iou_process and self._iou_process.returncode is None:
|
||||
return True
|
||||
return False
|
||||
|
||||
@ -661,7 +658,7 @@ class IOUVM(BaseVM):
|
||||
:returns: True or False
|
||||
"""
|
||||
|
||||
if self._iouyap_process:
|
||||
if self._iouyap_process and self._iouyap_process.returncode is None:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user