Module: check_mk
Branch: master
Commit: b675387019da7632e69edad542c866b49163487a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b675387019da76…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 29 08:22:40 2016 +0200
WATO webapi: now really fixed format
---
web/htdocs/webapi.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/webapi.py b/web/htdocs/webapi.py
index 02dd0a3..34b18e2 100644
--- a/web/htdocs/webapi.py
+++ b/web/htdocs/webapi.py
@@ -62,8 +62,10 @@ def page_api():
# The API uses JSON format by default and python as optional alternative
output_format = html.var("output_format", "json")
if output_format not in [ "json", "python" ]:
- html.set_output_format("json")
raise MKUserError(None, "Only \"json\" and
\"python\" are supported as output formats")
+ else:
+ html.set_output_format(output_format)
+
if not config.user.get("automation_secret"):
raise MKAuthException("The WATO API is only available for automation
users")
@@ -104,5 +106,4 @@ def page_api():
if html.output_format == "json":
html.write(json.dumps(response))
else:
- html.set_output_format("python")
html.write(repr(response))