mirror of
https://github.com/ansible/awx.git
synced 2026-05-16 13:57:39 -02:30
Adjust inventory computed field calculations to happen in the celery context
This commit is contained in:
@@ -755,6 +755,7 @@ class HostSerializer(BaseSerializerWithVariables):
|
||||
d['last_job']['job_template_name'] = obj.last_job.job_template.name
|
||||
except (KeyError, AttributeError):
|
||||
pass
|
||||
# TODO: This is slow
|
||||
d['all_groups'] = [{'id': g.id, 'name': g.name} for g in obj.all_groups.all()]
|
||||
d['groups'] = [{'id': g.id, 'name': g.name} for g in obj.groups.all()]
|
||||
d['recent_jobs'] = [{'id': j.job.id, 'name': j.job.job_template.name, 'status': j.job.status, 'finished': j.job.finished} \
|
||||
|
||||
@@ -38,7 +38,6 @@ from awx.main.task_engine import TaskSerializer
|
||||
from awx.main.models import *
|
||||
from awx.main.utils import *
|
||||
from awx.main.access import get_user_queryset
|
||||
from awx.main.signals import ignore_inventory_computed_fields, ignore_inventory_group_removal
|
||||
from awx.api.authentication import JobTaskAuthentication
|
||||
from awx.api.permissions import *
|
||||
from awx.api.renderers import *
|
||||
|
||||
Reference in New Issue
Block a user