From 333347d113de045faf0e628a2410c39ed557d8b1 Mon Sep 17 00:00:00 2001 From: Robert Fletcher Date: Mon, 23 Jan 2017 16:15:18 -0500 Subject: [PATCH] Radiator JSON output (#329) Json output from radiator when Accept header is application/json --- puppetboard/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/puppetboard/app.py b/puppetboard/app.py index 4675e7e..a709ed2 100644 --- a/puppetboard/app.py +++ b/puppetboard/app.py @@ -1115,6 +1115,10 @@ def radiator(env): stats['unchanged_percent'] = 0 stats['unreported_percent'] = 0 + if ('Accept' in request.headers and + request.headers["Accept"] == 'application/json'): + return jsonify(**stats) + return render_template( 'radiator.html', stats=stats,