From 03114be505000a01b4e16e32f9613ca5999f652f Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 19 Aug 2014 10:36:33 -0400 Subject: [PATCH] Hide module args at low/default verbosity setting --- awx/main/management/commands/run_callback_receiver.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/awx/main/management/commands/run_callback_receiver.py b/awx/main/management/commands/run_callback_receiver.py index 10c3a5a351..0d91fe559a 100644 --- a/awx/main/management/commands/run_callback_receiver.py +++ b/awx/main/management/commands/run_callback_receiver.py @@ -136,6 +136,10 @@ class CallbackReceiver(object): parent_id = data.get('parent', None) if not event or 'job_id' not in data: return + try: + verbose = Job.objects.get(id=data['job_id']).verbosity + except Exception, e: + verbose = 0 try: if not isinstance(data['created'], datetime.datetime): data['created'] = parse_datetime(data['created']) @@ -152,6 +156,10 @@ class CallbackReceiver(object): try: if event == 'playbook_on_stats': 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) if parent_id is not None: job_event.parent = JobEvent.objects.get(id=parent_id)