Merge pull request #24136 from rallytime/bp-24104

Backport #24104 to 2015.5
This commit is contained in:
Justin Findlay 2015-05-26 09:58:47 -06:00
commit 89cdf976e1

View File

@ -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'):