From 4020ebaecffb4a6b6a4c0cb93febbafce993ed2d Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Fri, 26 Jun 2015 11:56:28 +0200 Subject: [PATCH] cloudstack: fix state=expunged in cs_instance --- lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py b/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py index 321e03023bc..f9f7c54bea3 100644 --- a/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py +++ b/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py @@ -633,7 +633,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack): if instance['state'].lower() in [ 'destroying', 'destroyed' ]: self.result['changed'] = True if not self.module.check_mode: - res = self.cs.expungeVirtualMachine(id=instance['id']) + res = self.cs.destroyVirtualMachine(id=instance['id'], expunge=True) elif instance['state'].lower() not in [ 'expunging' ]: self.result['changed'] = True @@ -645,7 +645,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack): poll_async = self.module.params.get('poll_async') if poll_async: - instance = self._poll_job(res, 'virtualmachine') + res = self._poll_job(res, 'virtualmachine') return instance