default and minimal callback: display warnings in a consistent manner (#21144)

* default/minimal callback: don't display warnings twice

* minimal callback: display warnings raised by MODULE_NO_JSON modules
This commit is contained in:
Pilou 2017-02-08 16:58:39 +01:00 committed by Brian Coca
parent 2efb692cc4
commit 4e5c9c3d0d
2 changed files with 10 additions and 4 deletions

View file

@ -55,6 +55,8 @@ class CallbackModule(CallbackBase):
self._display.display(msg, color=C.COLOR_ERROR)
self._handle_warnings(result._result)
if result._task.action in C.MODULE_NO_JSON and 'module_stderr' not in result._result:
self._display.display(self._command_generic_msg(result._host.get_name(), result._result, "FAILED"), color=C.COLOR_ERROR)
else:
@ -62,6 +64,9 @@ class CallbackModule(CallbackBase):
def v2_runner_on_ok(self, result):
self._clean_results(result._result, result._task.action)
self._handle_warnings(result._result)
if result._task.action in C.MODULE_NO_JSON:
self._display.display(self._command_generic_msg(result._host.get_name(), result._result, "SUCCESS"), color=C.COLOR_OK)
else:
@ -69,7 +74,6 @@ class CallbackModule(CallbackBase):
self._display.display("%s | SUCCESS => %s" % (result._host.get_name(), self._dump_results(result._result, indent=4)), color=C.COLOR_CHANGED)
else:
self._display.display("%s | SUCCESS => %s" % (result._host.get_name(), self._dump_results(result._result, indent=4)), color=C.COLOR_OK)
self._handle_warnings(result._result)
def v2_runner_on_skipped(self, result):
self._display.display("%s | SKIPPED" % (result._host.get_name()), color=C.COLOR_SKIP)