mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-18 20:37:57 +00:00
Lock VMware by VM instead of globally
Ref https://github.com/GNS3/gns3-gui/issues/1632
This commit is contained in:
parent
7255754fef
commit
0c87d8e1bd
@ -47,7 +47,6 @@ class VMware(BaseManager):
|
||||
def __init__(self):
|
||||
|
||||
super().__init__()
|
||||
self._execute_lock = asyncio.Lock()
|
||||
self._vmware_inventory_lock = asyncio.Lock()
|
||||
self._vmrun_path = None
|
||||
self._host_type = None
|
||||
@ -371,7 +370,6 @@ class VMware(BaseManager):
|
||||
|
||||
@asyncio.coroutine
|
||||
def _execute(self, subcommand, args, timeout=120):
|
||||
with (yield from self._execute_lock):
|
||||
if self.host_type is None:
|
||||
yield from self.check_vmware_version()
|
||||
|
||||
@ -413,7 +411,6 @@ class VMware(BaseManager):
|
||||
:param required_version: required vmrun version number
|
||||
"""
|
||||
|
||||
with (yield from self._execute_lock):
|
||||
vmrun_path = self.vmrun_path
|
||||
if not vmrun_path:
|
||||
vmrun_path = self.find_vmrun()
|
||||
|
@ -27,7 +27,7 @@ import tempfile
|
||||
|
||||
from gns3server.utils.telnet_server import TelnetServer
|
||||
from gns3server.utils.interfaces import interfaces
|
||||
from gns3server.utils.asyncio import wait_for_file_creation, wait_for_named_pipe_creation
|
||||
from gns3server.utils.asyncio import wait_for_file_creation, wait_for_named_pipe_creation, locked_coroutine
|
||||
from collections import OrderedDict
|
||||
from .vmware_error import VMwareError
|
||||
from ..nios.nio_udp import NIOUDP
|
||||
@ -99,7 +99,7 @@ class VMwareVM(BaseNode):
|
||||
|
||||
return self._vmnets
|
||||
|
||||
@asyncio.coroutine
|
||||
@locked_coroutine
|
||||
def _control_vm(self, subcommand, *additional_args):
|
||||
|
||||
args = [self._vmx_path]
|
||||
|
Loading…
Reference in New Issue
Block a user