mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
Return exception as string
Pyodbc returns exception as Python Exception class, typecast as string for fail_json. Partially fixes: #25010 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
da6f6d27e8
commit
077a2df1d6
5 changed files with 10 additions and 5 deletions
|
@ -100,6 +100,7 @@ else:
|
|||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.pycompat24 import get_exception
|
||||
from ansible.module_utils._text import to_native
|
||||
|
||||
|
||||
class NotSupportedError(Exception):
|
||||
|
@ -248,7 +249,7 @@ def main():
|
|||
raise
|
||||
except Exception:
|
||||
e = get_exception()
|
||||
module.fail_json(msg=e)
|
||||
module.fail_json(msg=to_native(e))
|
||||
|
||||
module.exit_json(changed=changed, role=role, ansible_facts={'vertica_roles': role_facts})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue