1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Hide module args at low/default verbosity setting

This commit is contained in:
Matthew Jones 2014-08-19 10:36:33 -04:00
parent 66e26cfa1d
commit 03114be505

View File

@ -136,6 +136,10 @@ class CallbackReceiver(object):
parent_id = data.get('parent', None) parent_id = data.get('parent', None)
if not event or 'job_id' not in data: if not event or 'job_id' not in data:
return return
try:
verbose = Job.objects.get(id=data['job_id']).verbosity
except Exception, e:
verbose = 0
try: try:
if not isinstance(data['created'], datetime.datetime): if not isinstance(data['created'], datetime.datetime):
data['created'] = parse_datetime(data['created']) data['created'] = parse_datetime(data['created'])
@ -152,6 +156,10 @@ class CallbackReceiver(object):
try: try:
if event == 'playbook_on_stats': if event == 'playbook_on_stats':
transaction.commit() transaction.commit()
print data
if verbose == 0 and res in data['event_data'] and 'invocation' in data['event_data']['res'] and \
'module_args' in data['event_data']['res']['invocation']:
data['event_data']['res']['invocation']['module_args'] = ""
job_event = JobEvent(**data) job_event = JobEvent(**data)
if parent_id is not None: if parent_id is not None:
job_event.parent = JobEvent.objects.get(id=parent_id) job_event.parent = JobEvent.objects.get(id=parent_id)