Make it to where we can track JobHostSummary objects for hosts that don't necessarily exist in inventory

This commit is contained in:
Matthew Jones
2014-07-14 15:34:25 -04:00
parent ccc6e16d2e
commit 6ee61d6c72
3 changed files with 466 additions and 8 deletions

View File

@@ -1306,9 +1306,11 @@ class JobHostSummarySerializer(BaseSerializer):
def get_related(self, obj):
res = super(JobHostSummarySerializer, self).get_related(obj)
res.update(dict(
job=reverse('api:job_detail', args=(obj.job.pk,)),
host=reverse('api:host_detail', args=(obj.host.pk,))
))
job=reverse('api:job_detail', args=(obj.job.pk,))))
if obj.host is not None:
res.update(dict(
host=reverse('api:host_detail', args=(obj.host.pk,))
))
return res
def get_summary_fields(self, obj):