Add support for marking module results uninteresting

Using python to collect data for later display is useful, as it allows
us to control what's output and what isn't. That's defeated by the
default behavior of logging all of the result parameters. Add a flag we
can set in result dicts that will cause us to discard the parameters
from the log on success. On failure we don't want to do this because on
failure all the debugging we can get is great.

Change-Id: Ic2295c7a8be30144fe47c5bd385e827bfd8095f2
This commit is contained in:
Monty Taylor 2017-07-08 10:12:44 -05:00
parent 9db79043f7
commit 37338d33bf
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 7 additions and 0 deletions

View File

@ -252,6 +252,13 @@ class CallbackModule(default.CallbackModule):
result_dict = dict(result._result)
self._clean_results(result_dict, result._task.action)
if '_zuul_nolog_return' in result_dict:
# We have a custom zuul module that doesn't want the parameters
# from its returned splatted to stdout. This is typically for
# modules that are collecting data to be displayed some other way.
for key in result_dict.keys():
if key != 'changed':
result_dict.pop(key)
if result_dict.get('changed', False):
status = 'changed'