[checkmk-commits] Check_MK Git: check_mk: Multisite: Use pprint when writing global settings

Mathias Kettner mk at mathias-kettner.de
Fri Nov 30 09:41:33 CET 2012


Module: check_mk
Branch: master
Commit: 5620402177d6022c6627608c882a8cfb20a63f3b
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5620402177d6022c6627608c882a8cfb20a63f3b

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Fri Nov 30 09:41:29 2012 +0100

Multisite: Use pprint when writing global settings

---

 ChangeLog          |    1 +
 web/htdocs/wato.py |    4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e0fd8cb..968b550 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@
     * Now showing correct representation of SI unit kilo ( k )
     * if perfometer now differs between byte and bit output
     * FIX: warn / crit levels in if-check when using "bit" as unit
+    * Use pprint when writing global settings (makes files more readable)
     
     WATO:
     * FIX: Fixed generated manual check definitions for checks without items
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 3ee7115..a15f9bc 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5367,7 +5367,7 @@ def render_main_menu(some_modules, columns = 2):
     html.write("</div>")
 
 #.
-#   .-Global-Vars----------------------------------------------------------.
+#   .-Global-Settings------------------------------------------------------.
 #   |          ____ _       _           _  __     __                       |
 #   |         / ___| | ___ | |__   __ _| | \ \   / /_ _ _ __ ___           |
 #   |        | |  _| |/ _ \| '_ \ / _` | |  \ \ / / _` | '__/ __|          |
@@ -5646,7 +5646,7 @@ def save_configuration_vars(vars, filename):
     out = create_user_file(filename, 'w')
     out.write("# Written by WATO\n# encoding: utf-8\n\n")
     for varname, value in vars.items():
-        out.write("%s = %r\n" % (varname, value))
+        out.write("%s = %s\n" % (varname, pprint.pformat(value)))
 
 #.
 #   .-Groups---------------------------------------------------------------.



More information about the checkmk-commits mailing list