Renaming per-item and retry callbacks

This commit is contained in:
James Cammarata 2016-03-18 15:15:59 -04:00
parent 959711b56e
commit 13f3cbaf3b
8 changed files with 21 additions and 21 deletions

View file

@ -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

@ -1 +1 @@
Subproject commit 22a9a15a5b08a037aa94087aba33839907881bf1
Subproject commit 345d9cbca86a8202f3044261c84429c305bd78b8

@ -1 +1 @@
Subproject commit 33e1d9d1cb41a4dacaf9c649d6889ae6ac0afcbf
Subproject commit f47b499bb9935b77b92f71eecfe981b9073184d6

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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: