Module: check_mk
Branch: master
Commit: a286a8e9a2204db914f54ba2525d4eaeb17fa9ae
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a286a8e9a2204d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 8 17:09:00 2018 +0100
Active check now also get their check context
Change-Id: I6b4bf3e08d0854818f621e51bc5d4581ff5a0b81
---
cmk_base/checks.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/cmk_base/checks.py b/cmk_base/checks.py
index c83494b..f99fa80 100644
--- a/cmk_base/checks.py
+++ b/cmk_base/checks.py
@@ -145,6 +145,7 @@ def load_checks(filelist):
known_vars = check_context.keys()
known_checks = check_info.keys()
+ known_active_checks = active_check_info.keys()
load_check_includes(f, check_context)
@@ -159,11 +160,15 @@ def load_checks(filelist):
continue
new_checks = set(check_info.keys()).difference(known_checks)
+ new_active_checks =
set(active_check_info.keys()).difference(known_active_checks)
# Now store the check context for all checks found in this file
for check_plugin_name in new_checks:
_check_contexts[check_plugin_name] = check_context
+ for check_plugin_name in new_active_checks:
+ _check_contexts[check_plugin_name] = check_context
+
# Collect all variables that the check file did introduce compared to the
# default check context
new_check_vars = {}
@@ -199,6 +204,7 @@ def load_checks(filelist):
# Keep track of which variable needs to be set to which context
context_ident_list = _check_variables.setdefault(varname, [])
context_ident_list += new_checks
+ context_ident_list += new_active_checks
# Now convert check_info to new format.
convert_check_info()