mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Renaming per-item and retry callbacks
This commit is contained in:
@@ -341,15 +341,15 @@ class CallbackBase:
|
||||
def v2_playbook_on_include(self, included_file):
|
||||
pass #no v1 correspondance
|
||||
|
||||
def v2_playbook_item_on_ok(self, result):
|
||||
def v2_runner_item_on_ok(self, result):
|
||||
pass
|
||||
|
||||
def v2_playbook_item_on_failed(self, result):
|
||||
def v2_runner_item_on_failed(self, result):
|
||||
pass
|
||||
|
||||
def v2_playbook_item_on_skipped(self, result):
|
||||
def v2_runner_item_on_skipped(self, result):
|
||||
pass
|
||||
|
||||
def v2_playbook_retry(self, result):
|
||||
def v2_runner_retry(self, result):
|
||||
pass
|
||||
|
||||
|
||||
@@ -63,14 +63,14 @@ class CallbackModule(CallbackModule_default):
|
||||
def v2_playbook_on_include(self, included_file):
|
||||
pass
|
||||
|
||||
def v2_playbook_item_on_ok(self, result):
|
||||
def v2_runner_item_on_ok(self, result):
|
||||
self.display_task_banner()
|
||||
self.super_ref.v2_playbook_item_on_ok(result)
|
||||
self.super_ref.v2_runner_item_on_ok(result)
|
||||
|
||||
def v2_playbook_item_on_skipped(self, result):
|
||||
def v2_runner_item_on_skipped(self, result):
|
||||
pass
|
||||
|
||||
def v2_playbook_item_on_failed(self, result):
|
||||
def v2_runner_item_on_failed(self, result):
|
||||
self.display_task_banner()
|
||||
self.super_ref.v2_playbook_item_on_failed(result)
|
||||
self.super_ref.v2_runner_item_on_failed(result)
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ class CallbackModule(CallbackBase):
|
||||
if diff:
|
||||
self._display.display(diff)
|
||||
|
||||
def v2_playbook_item_on_ok(self, result):
|
||||
def v2_runner_item_on_ok(self, result):
|
||||
delegated_vars = result._result.get('_ansible_delegated_vars', None)
|
||||
if result._task.action == 'include':
|
||||
return
|
||||
@@ -181,7 +181,7 @@ class CallbackModule(CallbackBase):
|
||||
msg += " => %s" % self._dump_results(result._result)
|
||||
self._display.display(msg, color=color)
|
||||
|
||||
def v2_playbook_item_on_failed(self, result):
|
||||
def v2_runner_item_on_failed(self, result):
|
||||
delegated_vars = result._result.get('_ansible_delegated_vars', None)
|
||||
if 'exception' in result._result:
|
||||
if self._display.verbosity < 3:
|
||||
@@ -205,7 +205,7 @@ class CallbackModule(CallbackBase):
|
||||
self._display.display(msg + " (item=%s) => %s" % (self._get_item(result._result), self._dump_results(result._result)), color=C.COLOR_ERROR)
|
||||
self._handle_warnings(result._result)
|
||||
|
||||
def v2_playbook_item_on_skipped(self, result):
|
||||
def v2_runner_item_on_skipped(self, result):
|
||||
if C.DISPLAY_SKIPPED_HOSTS:
|
||||
msg = "skipping: [%s] => (item=%s) " % (result._host.get_name(), self._get_item(result._result))
|
||||
if (self._display.verbosity > 0 or '_ansible_verbose_always' in result._result) and not '_ansible_verbose_override' in result._result:
|
||||
@@ -257,7 +257,7 @@ class CallbackModule(CallbackBase):
|
||||
if val:
|
||||
self._display.vvvv('%s: %s' % (option,val))
|
||||
|
||||
def v2_playbook_retry(self, result):
|
||||
def v2_runner_retry(self, result):
|
||||
msg = "FAILED - RETRYING: %s (%d retries left)." % (result._task, result._result['retries'] - result._result['attempts'])
|
||||
if (self._display.verbosity > 2 or '_ansible_verbose_always' in result._result) and not '_ansible_verbose_override' in result._result:
|
||||
msg += "Result was: %s" % self._dump_results(result._result)
|
||||
|
||||
@@ -35,5 +35,5 @@ class CallbackModule(CallbackModule_default):
|
||||
def v2_runner_on_skipped(self, result):
|
||||
pass
|
||||
|
||||
def v2_playbook_item_on_skipped(self, result):
|
||||
def v2_runner_item_on_skipped(self, result):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user