mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Check for uBridge version and catch uBridge errors.
This commit is contained in:
1 parent
f0649b4ac3
commit
fc0409286b
4 files changed
+30
-7
No files matched your search
@@ -28,6 +28,7 @@ import tempfile
|
||||
|
||||
from pkg_resources import parse_version
|
||||
from gns3server.ubridge.hypervisor import Hypervisor
|
||||
from gns3server.ubridge.ubridge_error import UbridgeError
|
||||
from gns3server.utils.telnet_server import TelnetServer
|
||||
from gns3server.utils.interfaces import get_windows_interfaces
|
||||
from collections import OrderedDict
|
||||
@@ -357,6 +358,8 @@ class VMwareVM(BaseVM):
|
||||
if not ubridge_path or not os.path.isfile(ubridge_path):
|
||||
raise VMwareError("ubridge is necessary to start a VMware VM")
|
||||
|
||||
yield from self._start_ubridge()
|
||||
|
||||
try:
|
||||
self._vmx_pairs = self.manager.parse_vmware_file(self._vmx_path)
|
||||
except OSError as e:
|
||||
@@ -375,7 +378,6 @@ class VMwareVM(BaseVM):
|
||||
else:
|
||||
yield from self._control_vm("start")
|
||||
|
||||
yield from self._start_ubridge()
|
||||
for adapter_number in range(0, self._adapters):
|
||||
nio = self._ethernet_adapters[adapter_number].get_nio(0)
|
||||
if nio:
|
||||
|
||||
@@ -27,16 +27,16 @@ import signal
|
||||
import re
|
||||
import asyncio
|
||||
import shutil
|
||||
import gns3server.utils.asyncio
|
||||
|
||||
from gns3server.utils.asyncio import wait_for_process_termination
|
||||
from gns3server.utils.asyncio import monitor_process
|
||||
from gns3server.utils.asyncio import subprocess_check_output
|
||||
from pkg_resources import parse_version
|
||||
from .vpcs_error import VPCSError
|
||||
from ..adapters.ethernet_adapter import EthernetAdapter
|
||||
from ..nios.nio_udp import NIOUDP
|
||||
from ..nios.nio_tap import NIOTAP
|
||||
from ..base_vm import BaseVM
|
||||
from ...utils.asyncio import subprocess_check_output, monitor_process
|
||||
|
||||
|
||||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
@@ -268,7 +268,7 @@ class VPCSVM(BaseVM):
|
||||
self._terminate_process()
|
||||
if self._process.returncode is None:
|
||||
try:
|
||||
yield from gns3server.utils.asyncio.wait_for_process_termination(self._process, timeout=3)
|
||||
yield from 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))
|
||||
|
||||
Reference in new issue
Block a user