Fix string coercion problem in error handling code 10:50 (#16270)

Manifests as the following stack trace
  File "/usr/local/Cellar/ansible/2.0.1.0/libexec/lib/python2.7/site-packages/ansible/utils/display.py", line 259, in error
      new_msg = u"ERROR! " + msg
      TypeError: coercing to Unicode: need string or buffer, AnsibleParserError found
This commit is contained in:
art-at-sky 2016-06-17 20:02:01 +01:00 committed by Toshio Kuratomi
parent 73fcf9ba6e
commit 38590fbab9

View file

@ -278,7 +278,7 @@ class Display:
wrapped = textwrap.wrap(new_msg, self.columns)
new_msg = u"\n".join(wrapped) + u"\n"
else:
new_msg = u"ERROR! " + msg
new_msg = u"ERROR! %s" % msg
if new_msg not in self._errors:
self.display(new_msg, color=C.COLOR_ERROR, stderr=True)
self._errors[new_msg] = 1