mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Relocate use of ERROR to display class, to avoid doubling up
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user