diff --git a/cloud/cloudstack/cs_account.py b/cloud/cloudstack/cs_account.py index 313c786dee3..399dfa090cc 100644 --- a/cloud/cloudstack/cs_account.py +++ b/cloud/cloudstack/cs_account.py @@ -400,6 +400,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets diff --git a/cloud/cloudstack/cs_affinitygroup.py b/cloud/cloudstack/cs_affinitygroup.py index e4460b93695..2a8de46fe41 100644 --- a/cloud/cloudstack/cs_affinitygroup.py +++ b/cloud/cloudstack/cs_affinitygroup.py @@ -243,6 +243,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets diff --git a/cloud/cloudstack/cs_firewall.py b/cloud/cloudstack/cs_firewall.py index 012005432fc..8a63710cf4a 100644 --- a/cloud/cloudstack/cs_firewall.py +++ b/cloud/cloudstack/cs_firewall.py @@ -327,6 +327,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets diff --git a/cloud/cloudstack/cs_instance.py b/cloud/cloudstack/cs_instance.py index d8db6b683c8..1f5cc6ca393 100644 --- a/cloud/cloudstack/cs_instance.py +++ b/cloud/cloudstack/cs_instance.py @@ -825,6 +825,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets diff --git a/cloud/cloudstack/cs_instancegroup.py b/cloud/cloudstack/cs_instancegroup.py index dc216733c63..d62004cc94f 100644 --- a/cloud/cloudstack/cs_instancegroup.py +++ b/cloud/cloudstack/cs_instancegroup.py @@ -220,6 +220,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets diff --git a/cloud/cloudstack/cs_iso.py b/cloud/cloudstack/cs_iso.py index b0048c75f45..43367530855 100644 --- a/cloud/cloudstack/cs_iso.py +++ b/cloud/cloudstack/cs_iso.py @@ -313,6 +313,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets diff --git a/cloud/cloudstack/cs_portforward.py b/cloud/cloudstack/cs_portforward.py index 127979e3d79..aa0401355cd 100644 --- a/cloud/cloudstack/cs_portforward.py +++ b/cloud/cloudstack/cs_portforward.py @@ -423,6 +423,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets diff --git a/cloud/cloudstack/cs_securitygroup.py b/cloud/cloudstack/cs_securitygroup.py index ec5f8d59ad4..73a54fef795 100644 --- a/cloud/cloudstack/cs_securitygroup.py +++ b/cloud/cloudstack/cs_securitygroup.py @@ -187,6 +187,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets diff --git a/cloud/cloudstack/cs_securitygroup_rule.py b/cloud/cloudstack/cs_securitygroup_rule.py index cc21ac9022e..ef48b3896ce 100644 --- a/cloud/cloudstack/cs_securitygroup_rule.py +++ b/cloud/cloudstack/cs_securitygroup_rule.py @@ -428,6 +428,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets diff --git a/cloud/cloudstack/cs_sshkeypair.py b/cloud/cloudstack/cs_sshkeypair.py index 995e0b5b81a..0d2e2c822f1 100644 --- a/cloud/cloudstack/cs_sshkeypair.py +++ b/cloud/cloudstack/cs_sshkeypair.py @@ -245,6 +245,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets diff --git a/cloud/cloudstack/cs_vmsnapshot.py b/cloud/cloudstack/cs_vmsnapshot.py index d5d84bd8ea7..b71901a317f 100644 --- a/cloud/cloudstack/cs_vmsnapshot.py +++ b/cloud/cloudstack/cs_vmsnapshot.py @@ -314,6 +314,9 @@ def main(): except CloudStackException, e: module.fail_json(msg='CloudStackException: %s' % str(e)) + except Exception, e: + module.fail_json(msg='Exception: %s' % str(e)) + module.exit_json(**result) # import module snippets