diff --git a/cloud/cloudstack/cs_account.py b/cloud/cloudstack/cs_account.py index 052354c581e..e96d8e12638 100644 --- a/cloud/cloudstack/cs_account.py +++ b/cloud/cloudstack/cs_account.py @@ -326,7 +326,7 @@ class AnsibleCloudStackAccount(AnsibleCloudStack): if not self.module.check_mode: res = self.cs.deleteAccount(id=account['id']) - if 'errortext' in account: + if 'errortext' in res: self.module.fail_json(msg="Failed: '%s'" % res['errortext']) poll_async = self.module.params.get('poll_async')