mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-14 04:41:27 +00:00
Renaming per-item and retry callbacks
This commit is contained in:
@@ -106,15 +106,15 @@ class ResultProcess(multiprocessing.Process):
|
||||
|
||||
# send callbacks for 'non final' results
|
||||
if '_ansible_retry' in result._result:
|
||||
self._send_result(('v2_playbook_retry', result))
|
||||
self._send_result(('v2_runner_retry', result))
|
||||
continue
|
||||
elif '_ansible_item_result' in result._result:
|
||||
if result.is_failed() or result.is_unreachable():
|
||||
self._send_result(('v2_playbook_item_on_failed', result))
|
||||
self._send_result(('v2_runner_item_on_failed', result))
|
||||
elif result.is_skipped():
|
||||
self._send_result(('v2_playbook_item_on_skipped', result))
|
||||
self._send_result(('v2_runner_item_on_skipped', result))
|
||||
else:
|
||||
self._send_result(('v2_playbook_item_on_ok', result))
|
||||
self._send_result(('v2_runner_item_on_ok', result))
|
||||
if 'diff' in result._result:
|
||||
self._send_result(('v2_on_file_diff', result))
|
||||
continue
|
||||
|
||||
Submodule lib/ansible/modules/core updated: 22a9a15a5b...345d9cbca8
Submodule lib/ansible/modules/extras updated: 33e1d9d1cb...f47b499bb9
@@ -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
|
||||
|
||||
@@ -329,7 +329,7 @@ class StrategyBase:
|
||||
self._variable_manager.set_nonpersistent_facts(target_host, facts)
|
||||
else:
|
||||
self._variable_manager.set_host_facts(target_host, facts)
|
||||
elif result[0].startswith('v2_playbook_item') or result[0] == 'v2_playbook_retry':
|
||||
elif result[0].startswith('v2_runner_item') or result[0] == 'v2_runner_retry':
|
||||
self._tqm.send_callback(result[0], result[1])
|
||||
elif result[0] == 'v2_on_file_diff':
|
||||
if self._diff:
|
||||
|
||||
Reference in New Issue
Block a user