Relocate use of ERROR to display class, to avoid doubling up

This commit is contained in:
James Cammarata 2016-01-19 12:09:04 -05:00
parent a7dd425620
commit b1223746cd
3 changed files with 11 additions and 11 deletions

View file

@ -54,9 +54,9 @@ class AnsibleError(Exception):
if obj and isinstance(obj, AnsibleBaseYAMLObject):
extended_error = self._get_extended_error()
if extended_error:
self.message = 'ERROR! %s\n\n%s' % (to_str(message), to_str(extended_error))
self.message = '%s\n\n%s' % (to_str(message), to_str(extended_error))
else:
self.message = 'ERROR! %s' % to_str(message)
self.message = '%s' % to_str(message)
def __str__(self):
return self.message

View file

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