mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Only try to stop a VM if it's not already stopped. (fixes #23364)
This commit is contained in:
parent
5488c4aaa2
commit
c53888415f
1 changed files with 2 additions and 1 deletions
|
@ -846,7 +846,8 @@ def destroy(name, call=None):
|
|||
vmobj = _getVmByName(name)
|
||||
if vmobj is not None:
|
||||
# stop the vm
|
||||
stop(name, vmobj['vmid'], 'action')
|
||||
if get_vm_status(vmid=vmobj['vmid'])['status'] != 'stopped':
|
||||
stop(name, vmobj['vmid'], 'action')
|
||||
|
||||
# wait until stopped
|
||||
if not wait_for_state(vmobj['vmid'], 'stopped'):
|
||||
|
|
Loading…
Add table
Reference in a new issue