cloudstack: fix state=expunged in cs_instance
This commit is contained in:
parent
5b86a15cdb
commit
94060b5ade
1 changed files with 2 additions and 2 deletions
|
@ -633,7 +633,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
|
||||||
if instance['state'].lower() in [ 'destroying', 'destroyed' ]:
|
if instance['state'].lower() in [ 'destroying', 'destroyed' ]:
|
||||||
self.result['changed'] = True
|
self.result['changed'] = True
|
||||||
if not self.module.check_mode:
|
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' ]:
|
elif instance['state'].lower() not in [ 'expunging' ]:
|
||||||
self.result['changed'] = True
|
self.result['changed'] = True
|
||||||
|
@ -645,7 +645,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
|
||||||
|
|
||||||
poll_async = self.module.params.get('poll_async')
|
poll_async = self.module.params.get('poll_async')
|
||||||
if poll_async:
|
if poll_async:
|
||||||
instance = self._poll_job(res, 'virtualmachine')
|
res = self._poll_job(res, 'virtualmachine')
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue