Module: check_mk
Branch: master
Commit: 1fd285dfdc39533faa63f58c01f7e0f8d5122ca4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1fd285dfdc3953…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Wed Apr 11 13:13:03 2018 +0200
Fix loading and saving of custom host and user attributes
Change-Id: I0e4f96fa215b4c28b78fb9739095fbfaf202a39e
---
web/htdocs/wato.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index fcb6f01..d6adb02 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -15542,8 +15542,8 @@ class CustomAttrMode(WatoMode):
}, lock=lock)
attrs = {}
- for self._what in [ "user", "host" ]:
- attrs[self._what] = vars.get("wato_%s_attrs" % self._what, [])
+ for what in [ "user", "host" ]:
+ attrs[what] = vars.get("wato_%s_attrs" % what, [])
return attrs
@@ -15560,10 +15560,10 @@ class CustomAttrMode(WatoMode):
def _save(self, attrs):
output = watolib.wato_fileheader()
- for self._what in [ "user", "host" ]:
- if self._what in attrs and len(attrs[self._what]) > 0:
- output += "if type(wato_%s_attrs) != list:\n wato_%s_attrs =
[]\n" % (self._what, self._what)
- output += "wato_%s_attrs += %s\n\n" % (self._what,
pprint.pformat(attrs[self._what]))
+ for what in [ "user", "host" ]:
+ if what in attrs and len(attrs[what]) > 0:
+ output += "if type(wato_%s_attrs) != list:\n wato_%s_attrs =
[]\n" % (what, what)
+ output += "wato_%s_attrs += %s\n\n" % (what,
pprint.pformat(attrs[what]))
make_nagios_directory(multisite_dir)
store.save_file(multisite_dir + "custom_attrs.mk", output)