Skip to content

Commit

Permalink
fix unixy when debug's msg is not text (ansible#36882)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoca authored and jborean93 committed Feb 28, 2018
1 parent cf67263 commit 809106b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/ansible/plugins/callback/unixy.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
- set as stdout in configuration
'''

from os.path import basename

from ansible import constants as C
from ansible.module_utils._text import to_text
from ansible.plugins.callback import CallbackBase
from ansible.utils.color import colorize, hostcolor
from ansible import constants as C
from os.path import basename


class CallbackModule(CallbackBase):
Expand Down Expand Up @@ -75,7 +77,7 @@ def _process_result_output(self, result, msg):
task_result = "%s -> %s %s" % (task_host, task_delegate_host, msg)

if result._result.get('msg') and result._result.get('msg') != "All items completed":
task_result += " | msg: " + result._result.get('msg')
task_result += " | msg: " + to_text(result._result.get('msg'))

if result._result.get('stdout'):
task_result += " | stdout: " + result._result.get('stdout')
Expand Down

0 comments on commit 809106b

Please sign in to comment.