Commit 38892e98 by Toshio Kuratomi

Convert exceptions to unicode using to_unicode rather than str. that stops…

Convert exceptions to unicode using to_unicode rather than str.  that stops unicode errors if the string has non-ascii text
parent aaa25eb7
...@@ -26,6 +26,7 @@ from ansible.playbook.conditional import Conditional ...@@ -26,6 +26,7 @@ from ansible.playbook.conditional import Conditional
from ansible.playbook.task import Task from ansible.playbook.task import Task
from ansible.plugins import lookup_loader, connection_loader, action_loader from ansible.plugins import lookup_loader, connection_loader, action_loader
from ansible.utils.listify import listify_lookup_plugin_terms from ansible.utils.listify import listify_lookup_plugin_terms
from ansible.utils.unicode import to_unicode
from ansible.utils.debug import debug from ansible.utils.debug import debug
...@@ -89,7 +90,7 @@ class TaskExecutor: ...@@ -89,7 +90,7 @@ class TaskExecutor:
debug("done dumping result, returning") debug("done dumping result, returning")
return result return result
except AnsibleError, e: 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): def _get_loop_items(self):
''' '''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment