1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-13 20:08:55 +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:
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
def create(self):
"""
@ -400,9 +408,8 @@ class VMwareVM(BaseVM):
Starts this VMware VM.
"""
# The lock dection is not working on OSX the .lck is never deleted
if os.path.exists(self._vmx_path + ".lck") and not sys.platform.startswith("darwin"):
raise VMwareError("VM locked, it is either running or being edited in VMware")
if (yield from self.is_running()):
raise VMwareError("The VM is already running in VMware")
ubridge_path = self.ubridge_path
if not ubridge_path or not os.path.isfile(ubridge_path):