Module: check_mk
Branch: master
Commit: da9052c67d89f378b252d74b0c82ae610a72323f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=da9052c67d89f3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 15 19:44:07 2019 +0200
Cleanup all direct config.host_extra_conf_merged calls
Change-Id: I243a3adf9b2e246ad4df9bb3eeeb08e794995de5
---
cmk_base/check_api.py | 7 ++++++-
cmk_base/config.py | 4 ----
cmk_base/inventory.py | 3 ++-
cmk_base/notify.py | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/cmk_base/check_api.py b/cmk_base/check_api.py
index 8bc1798..25383ce 100644
--- a/cmk_base/check_api.py
+++ b/cmk_base/check_api.py
@@ -208,7 +208,12 @@ def service_extra_conf(hostname, service, ruleset):
host_extra_conf = _config.host_extra_conf
in_binary_hostlist = _config.in_binary_hostlist
-host_extra_conf_merged = _config.host_extra_conf_merged
+
+
+# Compatibility wrapper for the pre 1.6 existant conf.host_extra_conf_merged()
+def host_extra_conf_merged(hostname, conf):
+ return _config.get_config_cache().host_extra_conf_merged(hostname, conf)
+
# TODO: Only used by logwatch check. Can we clean this up?
get_rule_options = _config.get_rule_options
diff --git a/cmk_base/config.py b/cmk_base/config.py
index 7e731e6..7dde648 100644
--- a/cmk_base/config.py
+++ b/cmk_base/config.py
@@ -1561,10 +1561,6 @@ def host_extra_conf(hostname, ruleset):
return get_config_cache().host_extra_conf(hostname, ruleset)
-def host_extra_conf_merged(hostname, conf):
- return get_config_cache().host_extra_conf_merged(hostname, conf)
-
-
#.
# .--Host matching-------------------------------------------------------.
# | _ _ _ _ _ _ |
diff --git a/cmk_base/inventory.py b/cmk_base/inventory.py
index c1ca54b..b77e0d4 100644
--- a/cmk_base/inventory.py
+++ b/cmk_base/inventory.py
@@ -328,7 +328,8 @@ def _gather_snmp_check_plugin_names_inventory(host_config,
def _get_inv_params(hostname, section_name):
- return config.host_extra_conf_merged(hostname,
config.inv_parameters.get(section_name, []))
+ return config.get_config_cache().host_extra_conf_merged(
+ hostname, config.inv_parameters.get(section_name, []))
#.
diff --git a/cmk_base/notify.py b/cmk_base/notify.py
index 91309f0..b60a033 100755
--- a/cmk_base/notify.py
+++ b/cmk_base/notify.py
@@ -589,8 +589,8 @@ def rbn_fallback_contacts():
def rbn_finalize_plugin_parameters(hostname, plugin, rule_parameters):
# Right now we are only able to finalize notification plugins with dict parameters..
if isinstance(rule_parameters, dict):
- parameters = config.host_extra_conf_merged(hostname,
-
config.notification_parameters.get(plugin, []))
+ parameters = config.get_config_cache().host_extra_conf_merged(
+ hostname, config.notification_parameters.get(plugin, []))
parameters.update(rule_parameters)
return parameters