Module: check_mk
Branch: master
Commit: 20b089bfc72eb54123fef89101a8240c710eeda0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=20b089bfc72eb5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue May 16 10:22:39 2017 +0200
4685 FIX Fixed exception when trying to reset a global setting twice
Change-Id: I41167cb6a2cac29373ac4d6245102fc3f2aac4b6
---
.werks/4685 | 11 +++++++++++
web/htdocs/wato.py | 9 ++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/4685 b/.werks/4685
new file mode 100644
index 0000000..fd19e7a
--- /dev/null
+++ b/.werks/4685
@@ -0,0 +1,11 @@
+Title: Fixed exception when trying to reset a global setting twice
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1494922940
+
+
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 68508f1..73c5ff1 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -6953,7 +6953,14 @@ def mode_edit_configvar(phase, what = 'globalvars'):
elif c == None:
return None
- del current_settings[varname]
+ if not html.check_transaction():
+ return
+
+ try:
+ del current_settings[varname]
+ except KeyError:
+ pass
+
msg = _("Resetted configuration variable %s to its default.") %
varname
else:
new_value = get_edited_value(valuespec)