Module: check_mk
Branch: master
Commit: 7d5b3f95a139a73c40c78967ead064143c0d91db
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d5b3f95a139a7…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Jan 22 11:24:36 2016 +0100
#2831 FIX Removing a previously set custom attribute for a contact did not work as
intented
The mechanism resetting a custom attribute to its default value was not working properly.
In the GUI you could see that the attribute was correctly unset.
However, the configuration for the monitoring core still used the old configured value.
This has been fixed.
---
.werks/2831 | 12 ++++++++++++
ChangeLog | 4 ++--
web/htdocs/userdb.py | 2 +-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/2831 b/.werks/2831
new file mode 100644
index 0000000..ccec531
--- /dev/null
+++ b/.werks/2831
@@ -0,0 +1,12 @@
+Title: Removing a previously set custom attribute for a contact did not work as intented
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i4
+Date: 1453457638
+Class: fix
+
+The mechanism resetting a custom attribute to its default value was not working
properly.
+In the GUI you could see that the attribute was correctly unset.
+However, the configuration for the monitoring core still used the old configured value..
+This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 7b675ca..cecc49e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -84,8 +84,6 @@
* 2918 agent_jolokia: jolokia can now be monitored using a special agent
* 2919 hp_webmgmt_status: New check for health status of various Hewlett-Packard
devices...
* 2920 hr_cpu: this check can now also supports per-core features...
- * 1322 solaris_prtdiag: New Check for Solaris Hardware State based on prtdiag
- * 1323 win_printers: Warning and Critical levels can now be set...
* 1322 solaris_prtdiag_status: New Check for Solaris Hardware State based on prtdiag
* 2921 printer_supply_ricoh: check now tries to handle negative readings properly...
* 2922 check_mk_agent.linux: mrpe sections can now be cached...
@@ -93,6 +91,7 @@
* 2829 filesystem checks: introduced default levels for inodes used (10%/5% free)...
* 2934 all temperature checks rewritten to use the shared temperature api...
NOTE: Please refer to the migration notes!
+ * 1323 win_printers: Warning and Critical levels can now be set...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
@@ -271,6 +270,7 @@
* 2925 FIX: Editing a notification rule for a missing user selected random other
user...
* 2905 FIX: Check plugins: Non existant man pages now result in helpful error
messages
* 2943 FIX: Preventing issues with password completion of browsers on user and
profile edit pages
+ * 2831 FIX: Removing a previously set custom attribute for a contact did not work as
intented...
Notifications:
* 2811 Mail notifications: Now able to add Host/Service Notes Url...
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 63e518e..b8753f8 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -438,7 +438,7 @@ def save_users(profiles):
core_custom_macros = [ k for k,o in user_attributes.items() if
o.get('add_custom_macro') ]
for user in profiles.keys():
for macro in core_custom_macros:
- if profiles[user].get(macro):
+ if macro in profiles[user]:
profiles[user]['_'+macro] = profiles[user][macro]
multisite_custom_values = [ k for k,v in user_attributes.items() if
v["domain"] == "multisite" ]