Python 3 compat

This commit is contained in:
wpetit 2022-09-01 13:22:46 +02:00
parent 83cd54b940
commit f297760287

View File

@ -61,6 +61,11 @@ from ansible.module_utils.basic import AnsibleModule
from creole.loader import creole_loader, config_save_values
import json
import sys
if sys.version_info[0] >= 3:
unicode = str
def run_module():
# define available arguments/parameters a user can pass to the module
@ -90,7 +95,7 @@ def run_module():
path = c.creole.find_first(byname=module.params['name'], type_='path')
value = getattr(c, path)
except Exception as ex:
module.fail_json(msg=ex.message, **result)
module.fail_json(msg=ex, **result)
result['name'] = module.params['name']
try: