1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Removes VMware lock check. Fixes #328.

This commit is contained in:
grossmj 2015-10-11 16:41:55 -06:00
parent 133b01b2a6
commit 5cb2b33a99

View File

@ -127,6 +127,14 @@ class VMwareVM(BaseVM):
except OSError as e: except OSError as e:
raise VMwareError('Could not write VMware VMX file "{}": {}'.format(self._vmx_path, e)) raise VMwareError('Could not write VMware VMX file "{}": {}'.format(self._vmx_path, e))
@asyncio.coroutine
def is_running(self):
result = yield from self.manager.execute("list", [])
if self._vmx_path in result:
return True
return False
@asyncio.coroutine @asyncio.coroutine
def create(self): def create(self):
""" """
@ -400,9 +408,8 @@ class VMwareVM(BaseVM):
Starts this VMware VM. Starts this VMware VM.
""" """
# The lock dection is not working on OSX the .lck is never deleted if (yield from self.is_running()):
if os.path.exists(self._vmx_path + ".lck") and not sys.platform.startswith("darwin"): raise VMwareError("The VM is already running in VMware")
raise VMwareError("VM locked, it is either running or being edited in VMware")
ubridge_path = self.ubridge_path ubridge_path = self.ubridge_path
if not ubridge_path or not os.path.isfile(ubridge_path): if not ubridge_path or not os.path.isfile(ubridge_path):