diff options
author | James E. Blair <jeblair@redhat.com> | 2019-09-04 13:13:41 -0700 |
---|---|---|
committer | James E. Blair <jeblair@redhat.com> | 2019-09-04 13:17:26 -0700 |
commit | cfe6a7b985125325605ef192b2de5fe1986ef569 (patch) | |
tree | 028d106c3a8c295f6b2a657290d2cf4ff562658e /zuul/ansible | |
parent | 90b1add80a2b7e1ee8a289dfb5add68c6ae47898 (diff) | |
download | zuul-cfe6a7b985125325605ef192b2de5fe1986ef569.tar.gz |
Fix "Set failed, unreachable, skipped statuses in json plugin"
This change was ineffective because it was modifying the wrong data.
Correct that and add a test.
Change-Id: I26cfba0ff9a3eca05314e12f3f1d66b934c505b6
Diffstat (limited to 'zuul/ansible')
-rw-r--r-- | zuul/ansible/base/callback/zuul_json.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zuul/ansible/base/callback/zuul_json.py b/zuul/ansible/base/callback/zuul_json.py index 4a2edcf6e..c07c68f78 100644 --- a/zuul/ansible/base/callback/zuul_json.py +++ b/zuul/ansible/base/callback/zuul_json.py @@ -158,11 +158,13 @@ class CallbackModule(CallbackBase): def v2_runner_on_failed(self, result, **kwargs): self.v2_runner_on_ok(result, **kwargs) - result._host.setdefault('failed', True) + self.results[-1]['tasks'][-1]['hosts'][result._host.name].\ + setdefault('failed', True) def v2_runner_on_skipped(self, result, **kwargs): self.v2_runner_on_ok(result, **kwargs) - result._host.setdefault('skipped', True) + self.results[-1]['tasks'][-1]['hosts'][result._host.name].\ + setdefault('skipped', True) def v2_playbook_on_stats(self, stats): """Display info about playbook statistics""" |