From 9ba0ba07ec5fb79ea5bc315714ca3b2bd547ecfd Mon Sep 17 00:00:00 2001 From: Chris Meyers Date: Fri, 19 May 2017 16:37:30 -0400 Subject: [PATCH] nest insights api response data --- awx/api/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/api/views.py b/awx/api/views.py index 2e3c25da0b..45933b4bda 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -2077,6 +2077,7 @@ class HostInsights(GenericAPIView): def get(self, request, *args, **kwargs): host = self.get_object() cred = None + ret = {} if host.insights_system_id is None: return Response(status=status.HTTP_204_NO_CONTENT) @@ -2102,7 +2103,8 @@ class HostInsights(GenericAPIView): return Response(status=status.HTTP_204_NO_CONTENT) try: - return Response(res.json()) + ret['insights_content'] = res.json() + return Response(ret) except ValueError: return Response(status=status.HTTP_204_NO_CONTENT)