Module: check_mk
Branch: master
Commit: cfd201ddd029097d5f7600524e2cb49f1e44d102
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cfd201ddd02909…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 7 09:55:57 2016 +0100
3975 FIX Improved error handling when trying to edit not existing global setting
---
.werks/3975 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 6 +++++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/3975 b/.werks/3975
new file mode 100644
index 0000000..f1067a3
--- /dev/null
+++ b/.werks/3975
@@ -0,0 +1,9 @@
+Title: Improved error handling when trying to edit not existing global setting
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i2
+Date: 1478508930
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index b407499..ca82417 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -73,6 +73,7 @@
* 3951 FIX: oracle_sessions: fixed bug with default absolute levels...
* 4039 FIX: Fix UnicodeEncodeError exception in WATO folder display...
* 4041 FIX: Fix exception when editing global configuration settings...
+ * 3975 FIX: Improved error handling when trying to edit not existing global setting
Notifications:
* 3957 mail: now allows extra HTML section between body and table
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 3501720..b9fcbfd 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -6537,7 +6537,11 @@ def mode_edit_configvar(phase, what = 'globalvars'):
return
varname = html.var("varname")
- domain, valuespec, need_restart, allow_reset, in_global_settings =
configvars()[varname]
+ try:
+ domain, valuespec, need_restart, allow_reset, in_global_settings =
configvars()[varname]
+ except KeyError:
+ raise MKGeneralException(_("The global setting \"%s\" does not
exist.") % varname)
+
if siteid:
current_settings = site.setdefault("globals", {})
else: