Module: check_mk
Branch: master
Commit: 9ebce956f18202b44507c874826dd08baa348be3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9ebce956f18202…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 24 16:24:39 2016 +0200
Fixed some issues in recent refactorings
---
cmk_base/rulesets.py | 1 +
modules/check_mk.py | 10 +++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/cmk_base/rulesets.py b/cmk_base/rulesets.py
index 9049098..10536c4 100644
--- a/cmk_base/rulesets.py
+++ b/cmk_base/rulesets.py
@@ -27,6 +27,7 @@
from cmk.regex import regex, is_regex
from cmk.exceptions import MKGeneralException
+import cmk_base
def parse_host_rule(rule):
rule, rule_options = get_rule_options(rule)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 8cd70f7..2e5bcd2 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1914,13 +1914,15 @@ def get_check_table(hostname, remove_duplicates=False,
use_cache=True, world='co
# Now add checks a cluster might receive from its nodes
if is_cluster(hostname):
+ single_host_checks =
cmk_base.config_cache.get_dict("single_host_checks")
+
for node in nodes_of(hostname):
- node_checks = g_singlehost_checks.get(node, [])
+ node_checks = single_host_checks.get(node, [])
if not skip_autochecks:
node_checks = node_checks + read_autochecks_of(node, world)
for entry in node_checks:
if len(entry) == 4:
- entry = entry[1:] # drop hostname from g_singlehost_checks
+ entry = entry[1:] # drop hostname from single_host_checks
checkname, item, params = entry
descr = service_description(node, checkname, item)
if hostname == host_of_clustered_service(node, descr):
@@ -2197,7 +2199,7 @@ def lookup_ip_address(hostname, family=None):
return cached_dns_lookup(hostname, family)
-def init_ip_lookup_cache():
+def initialize_ip_lookup_cache():
# Already created and initialized. Simply return it!
if cmk_base.config_cache.exists("ip_lookup"):
return cmk_base.config_cache.get_dict("ip_lookup")
@@ -2221,6 +2223,8 @@ def init_ip_lookup_cache():
def write_ip_lookup_cache():
+ ip_lookup_cache = cmk_base.config_cache.get_dict("ip_lookup")
+
# TODO: Write using cmk.store
suffix = "." + str(os.getpid())
file(cmk.paths.var_dir + '/ipaddresses.cache' + suffix,
'w').write(repr(ip_lookup_cache))