From 7ec34b4cb28bca4d4c6af1ac0abea351c167be54 Mon Sep 17 00:00:00 2001 From: James Hogarth Date: Fri, 4 Aug 2017 21:38:42 +0100 Subject: [PATCH] ISSUE 25470 - update patch from review details --- lib/ansible/plugins/callback/junit.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/ansible/plugins/callback/junit.py b/lib/ansible/plugins/callback/junit.py index e47353fd1d..367d5fcf8a 100644 --- a/lib/ansible/plugins/callback/junit.py +++ b/lib/ansible/plugins/callback/junit.py @@ -132,7 +132,7 @@ class CallbackModule(CallbackBase): task_data = self._task_data[task_uuid] - if self._fail_on_change == 'true' and status == 'changed': + if self._fail_on_change == 'true' and status == 'ok' and result._result.get('changed', False): status = 'failed' if status == 'failed' and 'EXPECTED FAILURE' in task_data.name: @@ -230,10 +230,7 @@ class CallbackModule(CallbackBase): self._finish_task('failed', result) def v2_runner_on_ok(self, result): - if result._result.get('changed', False): - self._finish_task('changed', result) - else: - self._finish_task('ok', result) + self._finish_task('ok', result) def v2_runner_on_skipped(self, result): self._finish_task('skipped', result)