Renaming per-item and retry callbacks

pull/14872/head
James Cammarata 9 years ago
parent 959711b56e
commit 13f3cbaf3b

@ -106,15 +106,15 @@ class ResultProcess(multiprocessing.Process):
# send callbacks for 'non final' results # send callbacks for 'non final' results
if '_ansible_retry' in result._result: if '_ansible_retry' in result._result:
self._send_result(('v2_playbook_retry', result)) self._send_result(('v2_runner_retry', result))
continue continue
elif '_ansible_item_result' in result._result: elif '_ansible_item_result' in result._result:
if result.is_failed() or result.is_unreachable(): 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(): elif result.is_skipped():
self._send_result(('v2_playbook_item_on_skipped', result)) self._send_result(('v2_runner_item_on_skipped', result))
else: else:
self._send_result(('v2_playbook_item_on_ok', result)) self._send_result(('v2_runner_item_on_ok', result))
if 'diff' in result._result: if 'diff' in result._result:
self._send_result(('v2_on_file_diff', result)) self._send_result(('v2_on_file_diff', result))
continue continue

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

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

@ -341,15 +341,15 @@ class CallbackBase:
def v2_playbook_on_include(self, included_file): def v2_playbook_on_include(self, included_file):
pass #no v1 correspondance pass #no v1 correspondance
def v2_playbook_item_on_ok(self, result): def v2_runner_item_on_ok(self, result):
pass pass
def v2_playbook_item_on_failed(self, result): def v2_runner_item_on_failed(self, result):
pass pass
def v2_playbook_item_on_skipped(self, result): def v2_runner_item_on_skipped(self, result):
pass pass
def v2_playbook_retry(self, result): def v2_runner_retry(self, result):
pass pass

@ -63,14 +63,14 @@ class CallbackModule(CallbackModule_default):
def v2_playbook_on_include(self, included_file): def v2_playbook_on_include(self, included_file):
pass pass
def v2_playbook_item_on_ok(self, result): def v2_runner_item_on_ok(self, result):
self.display_task_banner() 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 pass
def v2_playbook_item_on_failed(self, result): def v2_runner_item_on_failed(self, result):
self.display_task_banner() 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: if diff:
self._display.display(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) delegated_vars = result._result.get('_ansible_delegated_vars', None)
if result._task.action == 'include': if result._task.action == 'include':
return return
@ -181,7 +181,7 @@ class CallbackModule(CallbackBase):
msg += " => %s" % self._dump_results(result._result) msg += " => %s" % self._dump_results(result._result)
self._display.display(msg, color=color) 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) delegated_vars = result._result.get('_ansible_delegated_vars', None)
if 'exception' in result._result: if 'exception' in result._result:
if self._display.verbosity < 3: 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._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) 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: if C.DISPLAY_SKIPPED_HOSTS:
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(result._result))
if (self._display.verbosity > 0 or '_ansible_verbose_always' in result._result) and not '_ansible_verbose_override' in 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: if val:
self._display.vvvv('%s: %s' % (option,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']) 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: 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) msg += "Result was: %s" % self._dump_results(result._result)

@ -35,5 +35,5 @@ class CallbackModule(CallbackModule_default):
def v2_runner_on_skipped(self, result): def v2_runner_on_skipped(self, result):
pass pass
def v2_playbook_item_on_skipped(self, result): def v2_runner_item_on_skipped(self, result):
pass pass

@ -329,7 +329,7 @@ class StrategyBase:
self._variable_manager.set_nonpersistent_facts(target_host, facts) self._variable_manager.set_nonpersistent_facts(target_host, facts)
else: else:
self._variable_manager.set_host_facts(target_host, facts) 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]) self._tqm.send_callback(result[0], result[1])
elif result[0] == 'v2_on_file_diff': elif result[0] == 'v2_on_file_diff':
if self._diff: if self._diff:

Loading…
Cancel
Save