Module: check_mk
Branch: master
Commit: f3b593940de3d43181d8cefdea35cdf20de14660
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f3b593940de3d4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jun 8 08:52:59 2016 +0200
Host inventory API: XML output is now pretty printed
---
web/htdocs/inventory.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/inventory.py b/web/htdocs/inventory.py
index 69e5ff6..7496ce8 100644
--- a/web/htdocs/inventory.py
+++ b/web/htdocs/inventory.py
@@ -344,7 +344,12 @@ def write_xml(response):
raise MKGeneralException(_("You need to have the \"dicttoxml\"
python module installed to "
"be able to use the XML format."))
- html.write(dicttoxml.dicttoxml(response))
+ unformated_xml = dicttoxml.dicttoxml(response)
+
+ from xml.dom.minidom import parseString
+ dom = parseString(unformated_xml)
+
+ html.write(dom.toprettyxml())
def write_json(response):