From 809106ba7746afe09296416ee14e579dc5fc77c8 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 28 Feb 2018 18:23:39 -0500 Subject: [PATCH] fix unixy when debug's msg is not text (#36882) fixes #36850 --- lib/ansible/plugins/callback/unixy.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ansible/plugins/callback/unixy.py b/lib/ansible/plugins/callback/unixy.py index d5cbaea9a42..6c309cb3630 100644 --- a/lib/ansible/plugins/callback/unixy.py +++ b/lib/ansible/plugins/callback/unixy.py @@ -20,10 +20,12 @@ DOCUMENTATION = ''' - 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): @@ -75,7 +77,7 @@ class CallbackModule(CallbackBase): 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')