diff options
-rw-r--r-- | cloud/cloudstack/cs_iso.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cloud/cloudstack/cs_iso.py b/cloud/cloudstack/cs_iso.py index a61fb180..6aa06f89 100644 --- a/cloud/cloudstack/cs_iso.py +++ b/cloud/cloudstack/cs_iso.py @@ -240,6 +240,8 @@ class AnsibleCloudStackIso(AnsibleCloudStack): self.result['changed'] = True if not self.module.check_mode: res = self.cs.registerIso(**args) + if 'errortext' in res: + self.module.fail_json(msg="Failed: '%s'" % res['errortext']) iso = res['iso'][0] return iso @@ -284,6 +286,9 @@ class AnsibleCloudStackIso(AnsibleCloudStack): if not self.module.check_mode: res = self.cs.deleteIso(**args) + if 'errortext' in res: + self.module.fail_json(msg="Failed: '%s'" % res['errortext']) + self.poll_job(res, 'iso') return iso |