From badc5298a2de9bdd7b4875444b0bf45a316ac676 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Sun, 6 Sep 2015 01:42:56 +0200 Subject: [PATCH] cloudstack: cs_account: fix error handing on state=absent --- lib/ansible/modules/extras/cloud/cloudstack/cs_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/cloud/cloudstack/cs_account.py b/lib/ansible/modules/extras/cloud/cloudstack/cs_account.py index 052354c581..e96d8e1263 100644 --- a/lib/ansible/modules/extras/cloud/cloudstack/cs_account.py +++ b/lib/ansible/modules/extras/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')