Optimize the code for the callback module (#56827)

* Optimize the code for the callback module

* fix pep error

* Restore incorrectly submitted code

* fix pep error

* fix pep error

* Restore incorrectly submitted code

* Restore incorrectly submitted code

* fix condition

* fix condition

* fix pep error
This commit is contained in:
Kerwin Bryant
2019-06-07 03:37:28 +08:00
committed by ansibot
parent b9b0b23015
commit 95882faca6
4 changed files with 12 additions and 11 deletions

View File

@@ -178,7 +178,7 @@ class CallbackModule(CallbackBase):
else:
self._clean_results(result._result, result._task.action)
if (self._display.verbosity > 0 or '_ansible_verbose_always' in result._result) and '_ansible_verbose_override' not in result._result:
if self._run_is_verbose(result):
msg += " => %s" % (self._dump_results(result._result),)
self._display.display(msg, color=color)
@@ -226,7 +226,7 @@ class CallbackModule(CallbackBase):
self._process_items(result)
else:
msg = "skipping: %d/%d [%s]" % (self._host_counter, self._host_total, result._host.get_name())
if (self._display.verbosity > 0 or '_ansible_verbose_always' in result._result) and '_ansible_verbose_override' not in result._result:
if self._run_is_verbose(result):
msg += " => %s" % self._dump_results(result._result)
self._display.display(msg, color=C.COLOR_SKIP)