Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport/2.9/66098]: Fix duplicate log entries #67719

Merged
merged 2 commits into from Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,2 @@
bugfixes:
- unixy - fixed duplicate log entries on loops
6 changes: 6 additions & 0 deletions lib/ansible/plugins/callback/unixy.py
Expand Up @@ -122,6 +122,9 @@ def v2_runner_on_failed(self, result, ignore_errors=False):
self._preprocess_result(result)
display_color = C.COLOR_ERROR
msg = "failed"
item_value = self._get_item_label(result._result)
if item_value:
msg += " | item: %s" % (item_value,)

task_result = self._process_result_output(result, msg)
self._display.display(" " + task_result, display_color, stderr=self.display_failed_stderr)
Expand All @@ -132,6 +135,9 @@ def v2_runner_on_ok(self, result, msg="ok", display_color=C.COLOR_OK):
result_was_changed = ('changed' in result._result and result._result['changed'])
if result_was_changed:
msg = "done"
item_value = self._get_item_label(result._result)
if item_value:
msg += " | item: %s" % (item_value,)
display_color = C.COLOR_CHANGED
task_result = self._process_result_output(result, msg)
self._display.display(" " + task_result, display_color)
Expand Down