1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-28 02:25:27 +03:00

property filter no_log for item event loops

see: #5691
This commit is contained in:
Ryan Petrello 2017-03-22 11:14:48 -04:00
parent 5907b3dcad
commit f9b5b9aa91
2 changed files with 9 additions and 3 deletions

View File

@ -60,7 +60,7 @@ def executor(tmpdir_factory, request):
cli = PlaybookCLI(['', 'playbook.yml'])
cli.parse()
options = cli.parser.parse_args([])[0]
options = cli.parser.parse_args(['-v'])[0]
loader = DataLoader()
variable_manager = VariableManager()
inventory = Inventory(loader=loader, variable_manager=variable_manager,

View File

@ -30,6 +30,8 @@ from ansible.plugins.callback.default import CallbackModule as DefaultCallbackMo
from .events import event_context
from .minimal import CallbackModule as MinimalCallbackModule
CENSORED = "the output has been hidden due to the fact that 'no_log: true' was specified for this result" # noqa
class BaseCallbackModule(CallbackBase):
'''
@ -69,8 +71,12 @@ class BaseCallbackModule(CallbackBase):
else:
task = None
if event_data.get('res') and event_data['res'].get('_ansible_no_log', False):
event_data['res'] = {'censored': "the output has been hidden due to the fact that 'no_log: true' was specified for this result"} # noqa
if event_data.get('res'):
if event_data['res'].get('_ansible_no_log', False):
event_data['res'] = {'censored': CENSORED}
for i, item in enumerate(event_data['res'].get('results', [])):
if event_data['res']['results'][i].get('_ansible_no_log', False):
event_data['res']['results'][i] = {'censored': CENSORED}
with event_context.display_lock:
try: