From 60a38a196ac41686385368c0ef497c71326d867e Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 8 Jun 2018 22:49:00 -0400 Subject: [PATCH] add final_counter to EOF websocket --- awx/main/management/commands/run_callback_receiver.py | 4 ++-- awx/main/utils/common.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/awx/main/management/commands/run_callback_receiver.py b/awx/main/management/commands/run_callback_receiver.py index 0ffa218348..14e44496bb 100644 --- a/awx/main/management/commands/run_callback_receiver.py +++ b/awx/main/management/commands/run_callback_receiver.py @@ -162,7 +162,7 @@ class CallbackBrokerWorker(ConsumerMixin): if body.get('event') == 'EOF': try: - final_line_count = body.get('final_line_count', 0) + final_counter = body.get('final_counter', 0) logger.info('Event processing is finished for Job {}, sending notifications'.format(job_identifier)) # EOF events are sent when stdout for the running task is # closed. don't actually persist them to the database; we @@ -170,7 +170,7 @@ class CallbackBrokerWorker(ConsumerMixin): # approximation for when a job is "done" emit_channel_notification( 'jobs-summary', - dict(group_name='jobs', unified_job_id=job_identifier, final_line_count=final_line_count) + dict(group_name='jobs', unified_job_id=job_identifier, final_counter=final_counter) ) # Additionally, when we've processed all events, we should # have all the data we need to send out success/failure diff --git a/awx/main/utils/common.py b/awx/main/utils/common.py index 59499acb2e..ac1f30d25e 100644 --- a/awx/main/utils/common.py +++ b/awx/main/utils/common.py @@ -989,7 +989,7 @@ class OutputEventFilter(object): if value: self._emit_event(value) self._buffer = StringIO() - self._event_callback(dict(event='EOF', final_line_count=self._start_line)) + self._event_callback(dict(event='EOF', final_counter=self._counter - 1)) def _emit_event(self, buffered_stdout, next_event_data=None): next_event_data = next_event_data or {}