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

provide instance group name over websocket

This commit is contained in:
AlanCoding 2017-08-14 13:56:12 -04:00
parent 42ef2f265b
commit a6def691b7

View File

@ -914,6 +914,11 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique
def _websocket_emit_status(self, status): def _websocket_emit_status(self, status):
try: try:
status_data = dict(unified_job_id=self.id, status=status) status_data = dict(unified_job_id=self.id, status=status)
if status == 'waiting':
if self.instance_group:
status_data['instance_group_name'] = self.instance_group.name
else:
status_data['instance_group_name'] = None
status_data.update(self.websocket_emit_data()) status_data.update(self.websocket_emit_data())
status_data['group_name'] = 'jobs' status_data['group_name'] = 'jobs'
emit_channel_notification('jobs-status_changed', status_data) emit_channel_notification('jobs-status_changed', status_data)