mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
now show full callback stacktrace when vvv+
Still is a warning as we don't want to repeat it multiple times nor additional callbacks to stop ansible execution. hopefully we can avoid shipping w/o exceptions in the default/minimal callbacks... Also added feature that now allows for 'preformated' strings passed to warning
This commit is contained in:
parent
45355cd566
commit
737090dd13
2 changed files with 15 additions and 5 deletions
|
@ -202,10 +202,15 @@ class Display:
|
|||
self.display(new_msg.strip(), color=C.COLOR_DEPRECATE, stderr=True)
|
||||
self._deprecations[new_msg] = 1
|
||||
|
||||
def warning(self, msg):
|
||||
new_msg = "\n[WARNING]: %s" % msg
|
||||
wrapped = textwrap.wrap(new_msg, self.columns)
|
||||
new_msg = "\n".join(wrapped) + "\n"
|
||||
def warning(self, msg, formatted=False):
|
||||
|
||||
if not formatted:
|
||||
new_msg = "\n[WARNING]: %s" % msg
|
||||
wrapped = textwrap.wrap(new_msg, self.columns)
|
||||
new_msg = "\n".join(wrapped) + "\n"
|
||||
else:
|
||||
new_msg = "\n[WARNING]: \n%s" % msg
|
||||
|
||||
if new_msg not in self._warns:
|
||||
self.display(new_msg, color=C.COLOR_WARN, stderr=True)
|
||||
self._warns[new_msg] = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue