Convert exceptions to unicode using to_unicode rather than str. that stops unicode errors if the string has non-ascii text
This commit is contained in:
parent
aaa25eb75c
commit
38892e986e
1 changed files with 2 additions and 1 deletions
|
@ -26,6 +26,7 @@ from ansible.playbook.conditional import Conditional
|
|||
from ansible.playbook.task import Task
|
||||
from ansible.plugins import lookup_loader, connection_loader, action_loader
|
||||
from ansible.utils.listify import listify_lookup_plugin_terms
|
||||
from ansible.utils.unicode import to_unicode
|
||||
|
||||
from ansible.utils.debug import debug
|
||||
|
||||
|
@ -89,7 +90,7 @@ class TaskExecutor:
|
|||
debug("done dumping result, returning")
|
||||
return result
|
||||
except AnsibleError, e:
|
||||
return dict(failed=True, msg=str(e))
|
||||
return dict(failed=True, msg=to_unicode(e, nonstring='simplerepr'))
|
||||
|
||||
def _get_loop_items(self):
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue