mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Prevent double start of VirtualBox VM and VMware VM
Fix https://github.com/GNS3/gns3-gui/issues/1664
This commit is contained in:
parent
81b2894658
commit
75890c8f5a
@ -206,6 +206,9 @@ class VirtualBoxVM(BaseNode):
|
|||||||
Starts this VirtualBox VM.
|
Starts this VirtualBox VM.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if self.status == "started":
|
||||||
|
return
|
||||||
|
|
||||||
# resume the VM if it is paused
|
# resume the VM if it is paused
|
||||||
vm_state = yield from self._get_vm_state()
|
vm_state = yield from self._get_vm_state()
|
||||||
if vm_state == "paused":
|
if vm_state == "paused":
|
||||||
|
@ -386,6 +386,9 @@ class VMwareVM(BaseNode):
|
|||||||
Starts this VMware VM.
|
Starts this VMware VM.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if self.status == "started":
|
||||||
|
return
|
||||||
|
|
||||||
if (yield from self.is_running()):
|
if (yield from self.is_running()):
|
||||||
raise VMwareError("The VM is already running in VMware")
|
raise VMwareError("The VM is already running in VMware")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user