mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 07:54:00 -07:00
fix minor issues with debug and item labels (#41331)
* fix minor issues with debug and item labels - no more `item=None`, we always have a label now - debug should only show expected information, either msg= or the var in var= - also fixed method name, deprecated misleading _get_item
This commit is contained in:
parent
929ac6155c
commit
27c43daab8
4 changed files with 57 additions and 21 deletions
|
@ -205,7 +205,7 @@ class CallbackModule(CallbackBase):
|
|||
else:
|
||||
msg += ": [%s]" % result._host.get_name()
|
||||
|
||||
msg += " => (item=%s)" % (self._get_item(result._result),)
|
||||
msg += " => (item=%s)" % (self._get_item_label(result._result),)
|
||||
|
||||
if (self._display.verbosity > 0 or '_ansible_verbose_always' in result._result) and '_ansible_verbose_override' not in result._result:
|
||||
msg += " => %s" % self._dump_results(result._result)
|
||||
|
@ -224,12 +224,12 @@ class CallbackModule(CallbackBase):
|
|||
msg += "[%s]" % (result._host.get_name())
|
||||
|
||||
self._handle_warnings(result._result)
|
||||
self._display.display(msg + " (item=%s) => %s" % (self._get_item(result._result), self._dump_results(result._result)), color=C.COLOR_ERROR)
|
||||
self._display.display(msg + " (item=%s) => %s" % (self._get_item_label(result._result), self._dump_results(result._result)), color=C.COLOR_ERROR)
|
||||
|
||||
def v2_runner_item_on_skipped(self, result):
|
||||
if self._plugin_options.get('show_skipped_hosts', C.DISPLAY_SKIPPED_HOSTS): # fallback on constants for inherited plugins missing docs
|
||||
self._clean_results(result._result, result._task.action)
|
||||
msg = "skipping: [%s] => (item=%s) " % (result._host.get_name(), self._get_item(result._result))
|
||||
msg = "skipping: [%s] => (item=%s) " % (result._host.get_name(), self._get_item_label(result._result))
|
||||
if (self._display.verbosity > 0 or '_ansible_verbose_always' in result._result) and '_ansible_verbose_override' not in result._result:
|
||||
msg += " => %s" % self._dump_results(result._result)
|
||||
self._display.display(msg, color=C.COLOR_SKIP)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue