From 5904d2e1ee9648d8f21f4fcdef0cf1063ea06a60 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 22 Apr 2014 15:08:33 -0400 Subject: [PATCH] Switch back to serializer for event emissions and convert datetimes prior to json serialization --- awx/main/signals.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/awx/main/signals.py b/awx/main/signals.py index e5ce305b6b..f8c3d7886a 100644 --- a/awx/main/signals.py +++ b/awx/main/signals.py @@ -107,17 +107,10 @@ def emit_job_event_detail(sender, **kwargs): parent_id = instance.parent.id else: parent_id = None - event_serialized = dict(job_id=instance.job.id, - event_id=instance.id, - event=instance.event, - event_data=instance.event_data, - failed=instance.failed, - changed=instance.changed, - play=instance.play, - role=instance.role, - task=instance.task, - host = host_id, - parent = parent_id) + event_serialized = JobEventSerializer(instance).data + event_serialized["created"] = event_serialized["created"].isoformat() + event_serialized["modified"] = event_serialized["modified"].isoformat() + event_serialized["event_name"] = instance.event emit_websocket_notification('/socket.io/job_events', 'job_events-' + str(instance.job.id), event_serialized) post_save.connect(update_inventory_computed_fields, sender=Host)