mirror of
https://github.com/ansible/awx.git
synced 2026-02-21 13:10:11 -03:30
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
This commit is contained in:
@@ -2838,6 +2838,8 @@ class UnifiedJobStdout(RetrieveAPIView):
|
|||||||
return response
|
return response
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
return Response({"error": "Error generating stdout download file: %s" % str(e)}, status=status.HTTP_400_BAD_REQUEST)
|
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:
|
else:
|
||||||
return super(UnifiedJobStdout, self).retrieve(request, *args, **kwargs)
|
return super(UnifiedJobStdout, self).retrieve(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user