From c5ce9cdc126c2d306f4895d1b90b7f7cdcd9ec0f Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Fri, 21 Aug 2015 10:20:57 -0400 Subject: [PATCH] Fix stdout plaintext render * Was rendering as json (though text/plain) * Switched to rendering it as normal text with stripped ansi * Fixes: https://trello.com/c/TMyOak0H/142-api-v1-jobs-n-stdout-format-txt-emits-json-output --- awx/api/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/api/views.py b/awx/api/views.py index a0d383d758..f45a6b03aa 100644 --- a/awx/api/views.py +++ b/awx/api/views.py @@ -2838,6 +2838,8 @@ class UnifiedJobStdout(RetrieveAPIView): return response except Exception, e: return Response({"error": "Error generating stdout download file: %s" % str(e)}, status=status.HTTP_400_BAD_REQUEST) + elif request.accepted_renderer.format == 'txt': + return Response(unified_job.result_stdout) else: return super(UnifiedJobStdout, self).retrieve(request, *args, **kwargs)