Module: check_mk
Branch: master
Commit: fd509de492a35e49fc6f535477a49b95f417c234
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fd509de492a35e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri May 18 13:07:57 2018 +0200
Fixed check related variables not affecting check helpers on reload
* The check helper config was totally missing the configuration options
from the checks. This made reloads not set check related options.
* Initially the whole configuration was loaded instead of the check
helper config by accident. This made the helpers load at least the
check related configuration options during starting.
* This means: Initialisation during helper startup worked but later
reloads were not setting the possibly changed settings.
Change-Id: I48a2aa5c2f9c9b628d406ced53a7a2194480c32a
---
cmk_base/config.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/cmk_base/config.py b/cmk_base/config.py
index 07c9e56..7dc762b 100644
--- a/cmk_base/config.py
+++ b/cmk_base/config.py
@@ -119,8 +119,7 @@ def set_check_variables_for_checks():
# '----------------------------------------------------------------------'
def load(with_conf_d=True, validate_hosts=True, exclude_parents_mk=False):
- _add_check_variables_to_default_config()
- load_default_config()
+ _initialize_config()
vars_before_config = all_nonfunction_vars()
@@ -147,11 +146,19 @@ def load_packed_config():
The validations which are performed during load() also don't need to be
performed.
"""
+ _initialize_config()
+
filepath = cmk.paths.var_dir + "/core/helper_config.mk"
exec(marshal.load(open(filepath)), globals())
+
_perform_post_config_loading_actions()
+def _initialize_config():
+ _add_check_variables_to_default_config()
+ load_default_config()
+
+
def _perform_post_config_loading_actions():
"""These tasks must be performed after loading the Check_MK base
configuration"""
# First cleanup things (needed for e.g. reloading the config)
@@ -275,7 +282,7 @@ def get_derived_config_variable_names():
The origin variable (extra_service_conf) should not be exported to the helper config.
Only
the service levels are needed."""
- return [ "service_service_levels", "host_service_levels" ]
+ return set([ "service_service_levels", "host_service_levels" ])
def _verify_non_duplicate_hosts():