From 6e2b97427bfa7cfe3d61e88fc71625e86bfd66ab 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 --- cloud/cloudstack/cs_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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')