mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 22:07:36 -02:30
add job type to Host summary_fields.recent_jobs
see: https://github.com/ansible/awx/issues/5236
This commit is contained in:
@@ -1697,6 +1697,7 @@ class HostSerializer(BaseSerializerWithVariables):
|
|||||||
d.setdefault('recent_jobs', [{
|
d.setdefault('recent_jobs', [{
|
||||||
'id': j.job.id,
|
'id': j.job.id,
|
||||||
'name': j.job.job_template.name if j.job.job_template is not None else "",
|
'name': j.job.job_template.name if j.job.job_template is not None else "",
|
||||||
|
'type': j.job.get_real_instance_class()._meta.verbose_name.replace(' ', '_'),
|
||||||
'status': j.job.status,
|
'status': j.job.status,
|
||||||
'finished': j.job.finished,
|
'finished': j.job.finished,
|
||||||
} for j in obj.job_host_summaries.select_related('job__job_template').order_by('-created')[:5]])
|
} for j in obj.job_host_summaries.select_related('job__job_template').order_by('-created')[:5]])
|
||||||
|
|||||||
Reference in New Issue
Block a user