Module: check_mk
Branch: master
Commit: 1c168ef1edb844b61d8096280585f8cea686c831
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1c168ef1edb844…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Jan 24 17:25:17 2019 +0100
config.py: Reverted with_foreign_hosts detection to match the master
branch version. Will be optimized later on.
Change-Id: Icc4eba5b6e9af1b92723521906dc74c022420d38
---
cmk_base/config.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/cmk_base/config.py b/cmk_base/config.py
index 0b208d4..b76b69c 100644
--- a/cmk_base/config.py
+++ b/cmk_base/config.py
@@ -3083,8 +3083,9 @@ class ConfigCache(object):
rule_dict.setdefault(key, value)
return rule_dict
- def host_extra_conf(self, hostname, ruleset, include_foreign_hosts=False):
- cache_id = id(ruleset), include_foreign_hosts
+ def host_extra_conf(self, hostname, ruleset):
+ with_foreign_hosts = hostname not in self._all_processed_hosts
+ cache_id = id(ruleset), with_foreign_hosts
try:
return self._host_extra_conf_match_cache[cache_id][hostname]
except KeyError:
@@ -3093,7 +3094,7 @@ class ConfigCache(object):
try:
ruleset = self._host_extra_conf_ruleset_cache[cache_id]
except KeyError:
- ruleset = self._convert_host_ruleset(ruleset, include_foreign_hosts)
+ ruleset = self._convert_host_ruleset(ruleset, with_foreign_hosts)
self._host_extra_conf_ruleset_cache[cache_id] = ruleset
new_cache = {}
for value, hostname_list in ruleset:
@@ -3122,10 +3123,11 @@ class ConfigCache(object):
return new_rules
- def service_extra_conf(self, hostname, service, ruleset, with_foreign_hosts=False):
+ def service_extra_conf(self, hostname, service, ruleset):
"""Compute outcome of a service rule set that has an
item."""
# When the requested host is part of the local sites configuration,
# then use only the sites hosts for processing the rules
+ with_foreign_hosts = hostname not in self._all_processed_hosts
cache_id = id(ruleset), with_foreign_hosts
cached_ruleset = self._service_extra_conf_ruleset_cache.get(cache_id)