mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-24 09:10:22 -07:00
Relocate use of ERROR to display class, to avoid doubling up
This commit is contained in:
parent
a7dd425620
commit
b1223746cd
3 changed files with 11 additions and 11 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue