From dc6f0c12900d532aa78ca876fcd1f1269f02c2ff Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 3 Feb 2016 10:55:09 -0500 Subject: [PATCH] avoid logging color codes --- lib/ansible/utils/display.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/utils/display.py b/lib/ansible/utils/display.py index cd91af1a4f2..296a7b81806 100644 --- a/lib/ansible/utils/display.py +++ b/lib/ansible/utils/display.py @@ -111,6 +111,7 @@ class Display: # FIXME: this needs to be implemented #msg = utils.sanitize_output(msg) + nocolor = msg if color: msg = stringc(msg, color) @@ -135,7 +136,7 @@ class Display: sys.stderr.flush() if logger and not screen_only: - msg2 = msg.lstrip(u'\n') + msg2 = nocolor.lstrip(u'\n') msg2 = to_bytes(msg2) if sys.version_info >= (3,):