Module: check_mk
Branch: master
Commit: 640bdf2156ad179f854c658e9d7978b99b4b79f0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=640bdf2156ad17…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 3 20:59:32 2019 +0200
Cleaned up implicit dependency of HostConfig to ConfigCache
Change-Id: I78c06266cc774ebc1664417bbd1f560588cd80f0
---
cmk_base/config.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/cmk_base/config.py b/cmk_base/config.py
index f43a361..8503ac9 100644
--- a/cmk_base/config.py
+++ b/cmk_base/config.py
@@ -2775,11 +2775,12 @@ cmk_base.cleanup.register_cleanup(check_api_utils.reset_hostname)
class HostConfig(object):
- def __init__(self, hostname):
+ def __init__(self, config_cache, hostname):
+ # type: (ConfigCache, str) -> None
super(HostConfig, self).__init__()
self.hostname = hostname
- self._config_cache = get_config_cache()
+ self._config_cache = config_cache
self.is_cluster = is_cluster(hostname)
self.part_of_clusters = self._config_cache.clusters_of(hostname)
@@ -2939,7 +2940,7 @@ class ConfigCache(object):
if host_config:
return host_config
- host_config = self._host_configs[hostname] = HostConfig(hostname)
+ host_config = self._host_configs[hostname] = HostConfig(self, hostname)
return host_config
def _collect_hosttags(self):