Module: check_mk
Branch: master
Commit: efaf1735a5b232231b7366dd6db4596522c6b3d0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=efaf1735a5b232…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 20 12:45:14 2018 +0100
Only remove check variable settings from default_config when it was set before
Change-Id: Id4046592c86718fc492977be9d0c0e4f94d0d732
---
cmk_base/config.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/cmk_base/config.py b/cmk_base/config.py
index c1e94a8..52d6395 100644
--- a/cmk_base/config.py
+++ b/cmk_base/config.py
@@ -80,12 +80,18 @@ def add_check_variables(check_variables):
#
# In the same step we remove the check related configuration settings from the
# config module because they are not needed there anymore.
+#
+# And also remove it from the default config (in case it was present)
def set_check_variables_for_checks():
import cmk_base.checks
global_dict = globals()
for varname in cmk_base.checks.check_variable_names():
cmk_base.checks.set_check_variable(varname, global_dict.pop(varname))
- delattr(default_config, varname)
+
+ try:
+ delattr(default_config, varname)
+ except AttributeError:
+ pass
#.