Module: check_mk
Branch: master
Commit: 15df755a3f7b7bccd6d4b555af87b0145f5e0967
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=15df755a3f7b7b…
Author: Andreas <ab(a)mathias-kettner.de>
Date: Wed Jun 6 15:13:26 2018 +0200
5816 FIX Check parse_function is no longer called multiple times if there are several
subchecks for the same section
Change-Id: Ida7b446e067d434e5a05c0164ab9b562c4c23b35
---
.werks/5816 | 10 ++++++++++
cmk_base/data_sources/host_sections.py | 11 +++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/.werks/5816 b/.werks/5816
new file mode 100644
index 0000000..cfd8c17
--- /dev/null
+++ b/.werks/5816
@@ -0,0 +1,10 @@
+Title: Check parse_function is no longer called multiple times if there are several
subchecks for the same section
+Level: 2
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1528290762
+Class: fix
+
+
diff --git a/cmk_base/data_sources/host_sections.py
b/cmk_base/data_sources/host_sections.py
index a820905..147069e 100644
--- a/cmk_base/data_sources/host_sections.py
+++ b/cmk_base/data_sources/host_sections.py
@@ -129,17 +129,16 @@ class MultiHostSections(object):
for this check available.
"""
+ section_name = cmk_base.check_utils.section_name_of(check_plugin_name)
try:
- return self._section_content_cache[(hostname, ipaddress, check_plugin_name,
for_discovery)]
+ return self._section_content_cache[(hostname, ipaddress, section_name,
for_discovery)]
except KeyError:
- section_content = self._get_section_content(hostname, ipaddress,
check_plugin_name, for_discovery)
- self._section_content_cache[(hostname, ipaddress, check_plugin_name,
for_discovery)] = section_content
+ section_content = self._get_section_content(hostname, ipaddress,
check_plugin_name, section_name, for_discovery)
+ self._section_content_cache[(hostname, ipaddress, section_name,
for_discovery)] = section_content
return section_content
- def _get_section_content(self, hostname, ipaddress, check_plugin_name,
for_discovery):
- section_name = cmk_base.check_utils.section_name_of(check_plugin_name)
-
+ def _get_section_content(self, hostname, ipaddress, check_plugin_name, section_name,
for_discovery):
# First abstract cluster / non cluster hosts
host_entries = []
nodes = config.nodes_of(hostname)