From e5b6d802bf87f65751857e4cef06314490c91d7a Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 19 Oct 2015 16:52:27 -0400 Subject: [PATCH] Removing some cruft related to _local_action value on Task, which was removed Fixes #12819 --- lib/ansible/playbook/task.py | 1 - lib/ansible/plugins/callback/default.py | 24 ++++++------------------ lib/ansible/plugins/callback/skippy.py | 24 ++++++------------------ 3 files changed, 12 insertions(+), 37 deletions(-) diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py index 9ed8d9bfe96..b66c331c033 100644 --- a/lib/ansible/playbook/task.py +++ b/lib/ansible/playbook/task.py @@ -79,7 +79,6 @@ class Task(Base, Conditional, Taggable, Become): _ignore_errors = FieldAttribute(isa='bool') _loop = FieldAttribute(isa='string', private=True) _loop_args = FieldAttribute(isa='list', private=True) - _local_action = FieldAttribute(isa='string') _name = FieldAttribute(isa='string', default='') _notify = FieldAttribute(isa='list') _poll = FieldAttribute(isa='int') diff --git a/lib/ansible/plugins/callback/default.py b/lib/ansible/plugins/callback/default.py index f6ba1fe426f..4dcdd0c0de2 100644 --- a/lib/ansible/plugins/callback/default.py +++ b/lib/ansible/plugins/callback/default.py @@ -63,22 +63,14 @@ class CallbackModule(CallbackBase): if result._task.action == 'include': return elif result._result.get('changed', False): - if result._task.delegate_to is not None or result._task._local_action: - if result._task._local_action: - target = 'localhost' - else: - target = result._task.delegate_to - msg = "changed: [%s -> %s]" % (result._host.get_name(), target) + if result._task.delegate_to is not None: + msg = "changed: [%s -> %s]" % (result._host.get_name(), result._task.delegate_to) else: msg = "changed: [%s]" % result._host.get_name() color = 'yellow' else: - if result._task.delegate_to is not None or result._task._local_action: - if result._task._local_action: - target = 'localhost' - else: - target = result._task.delegate_to - msg = "ok: [%s -> %s]" % (result._host.get_name(), target) + if result._task.delegate_to is not None: + msg = "ok: [%s -> %s]" % (result._host.get_name(), result._task.delegate_to) else: msg = "ok: [%s]" % result._host.get_name() color = 'green' @@ -104,12 +96,8 @@ class CallbackModule(CallbackBase): self._display.display(msg, color='cyan') def v2_runner_on_unreachable(self, result): - if result._task.delegate_to or result._task._local_action: - if result._task._local_action: - target = 'localhost' - else: - target = result._task.delegate_to - self._display.display("fatal: [%s -> %s]: UNREACHABLE! => %s" % (result._host.get_name(), target, self._dump_results(result._result)), color='red') + if result._task.delegate_to: + self._display.display("fatal: [%s -> %s]: UNREACHABLE! => %s" % (result._host.get_name(), result._task.delegate_to, self._dump_results(result._result)), color='red') else: self._display.display("fatal: [%s]: UNREACHABLE! => %s" % (result._host.get_name(), self._dump_results(result._result)), color='red') diff --git a/lib/ansible/plugins/callback/skippy.py b/lib/ansible/plugins/callback/skippy.py index cd0df9bdd86..55dce2f358c 100644 --- a/lib/ansible/plugins/callback/skippy.py +++ b/lib/ansible/plugins/callback/skippy.py @@ -63,22 +63,14 @@ class CallbackModule(CallbackBase): msg = 'included: %s for %s' % (result._task.args.get('_raw_params'), result._host.name) color = 'cyan' elif result._result.get('changed', False): - if result._task.delegate_to is not None or result._task._local_action: - if result._task._local_action: - target = 'localhost' - else: - target = result._task.delegate_to - msg = "changed: [%s -> %s]" % (result._host.get_name(), target) + if result._task.delegate_to is not None: + msg = "changed: [%s -> %s]" % (result._host.get_name(), result._task.delegate_to) else: msg = "changed: [%s]" % result._host.get_name() color = 'yellow' else: - if result._task.delegate_to is not None or result._task._local_action: - if result._task._local_action: - target = 'localhost' - else: - target = result._task.delegate_to - msg = "ok: [%s -> %s]" % (result._host.get_name(), target) + if result._task.delegate_to is not None: + msg = "ok: [%s -> %s]" % (result._host.get_name(), result._task.delegate_to) else: msg = "ok: [%s]" % result._host.get_name() color = 'green' @@ -95,12 +87,8 @@ class CallbackModule(CallbackBase): def v2_runner_on_unreachable(self, result): - if result._task.delegate_to or result._task._local_action: - if result._task._local_action: - target = 'localhost' - else: - target = result._task.delegate_to - self._display.display("fatal: [%s -> %s]: UNREACHABLE! => %s" % (result._host.get_name(), target, self._dump_results(result._result)), color='red') + if result._task.delegate_to: + self._display.display("fatal: [%s -> %s]: UNREACHABLE! => %s" % (result._host.get_name(), result._task.delegate_to, self._dump_results(result._result)), color='red') else: self._display.display("fatal: [%s]: UNREACHABLE! => %s" % (result._host.get_name(), self._dump_results(result._result)), color='red')