mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Do not use str() on exceptions (#46950)
This commit is contained in:
@@ -20,7 +20,7 @@ DOCUMENTATION = '''
|
||||
import os
|
||||
|
||||
from ansible.constants import TREE_DIR
|
||||
from ansible.module_utils._text import to_bytes
|
||||
from ansible.module_utils._text import to_bytes, to_text
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
from ansible.utils.path import makedirs_safe
|
||||
|
||||
@@ -53,7 +53,7 @@ class CallbackModule(CallbackBase):
|
||||
with open(path, 'wb+') as fd:
|
||||
fd.write(buf)
|
||||
except (OSError, IOError) as e:
|
||||
self._display.warning("Unable to write to %s's file: %s" % (hostname, str(e)))
|
||||
self._display.warning(u"Unable to write to %s's file: %s" % (hostname, to_text(e)))
|
||||
|
||||
def result_to_tree(self, result):
|
||||
if self.tree:
|
||||
|
||||
Reference in New Issue
Block a user