Fix duplicate log entries (and add item support for failures) (#66098)

This commit is contained in:
akatch 2020-02-15 06:48:05 -06:00 committed by GitHub
parent ad2428c176
commit 936bd83614
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,6 +122,9 @@ class CallbackModule(CallbackModule_default):
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)
@ -132,6 +135,9 @@ class CallbackModule(CallbackModule_default):
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)