mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
corrected no_log for items and skipped tasks
corrected output from default callback added new tests for no_log loops updated makefile test to check for both positive and negative occurrences of no_log
This commit is contained in:
parent
86ef20c73b
commit
e2ae3215f6
5 changed files with 16 additions and 13 deletions
|
@ -108,15 +108,14 @@ class CallbackBase:
|
|||
ret.append(">> the files are different, but the diff library cannot compare unicode strings\n\n")
|
||||
|
||||
def _get_item(self, result):
|
||||
if '_ansible_no_log' in result:
|
||||
if '_ansible_no_log' in result and result['_ansible_no_log']:
|
||||
item = "(censored due to no_log)"
|
||||
else:
|
||||
item = getattr(result, 'item', "(censored due to no_log)")
|
||||
item = result['item']
|
||||
|
||||
return item
|
||||
|
||||
def _process_items(self, result):
|
||||
|
||||
for res in result._result['results']:
|
||||
newres = deepcopy(result)
|
||||
res['item'] = self._get_item(res)
|
||||
|
|
|
@ -88,13 +88,13 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
def v2_runner_on_skipped(self, result):
|
||||
if C.DISPLAY_SKIPPED_HOSTS:
|
||||
msg = "skipping: [%s]" % result._host.get_name()
|
||||
if result._task.loop and 'results' in result._result:
|
||||
self._process_items(result)
|
||||
else:
|
||||
msg = "skipping: [%s]" % result._host.get_name()
|
||||
if (self._display.verbosity > 0 or '_ansible_verbose_always' in result._result) and not '_ansible_verbose_override' in result._result:
|
||||
msg += " => %s" % self._dump_results(result._result)
|
||||
self._display.display(msg, color='cyan')
|
||||
self._display.display(msg, color='cyan')
|
||||
|
||||
def v2_runner_on_unreachable(self, result):
|
||||
if result._task.delegate_to:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue