[checkmk-commits] Check_MK Git: check_mk: Fix exception during discovery for empty sections when a check has extra_sections

Mathias Kettner mk at mathias-kettner.de
Thu Apr 2 16:41:16 CEST 2015


Module: check_mk
Branch: master
Commit: bf879e93ee738f5ff1703e661bba79c979c86a91
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bf879e93ee738f5ff1703e661bba79c979c86a91

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Thu Apr  2 16:41:13 2015 +0200

Fix exception during discovery for empty sections when a check has extra_sections

---

 modules/discovery.py |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/discovery.py b/modules/discovery.py
index 9e70635..222756f 100644
--- a/modules/discovery.py
+++ b/modules/discovery.py
@@ -221,8 +221,12 @@ def get_info_for_discovery(hostname, ipaddress, section_name, use_caches):
             return info
 
     max_cachefile_age = use_caches and inventory_max_cachefile_age or 0
-    info = apply_parse_function(add_nodeinfo(get_realhost_info(hostname, ipaddress, section_name, max_cachefile_age, ignore_check_interval=True), section_name), section_name)
-    if section_name in check_info and check_info[section_name]["extra_sections"]:
+    rh_info = get_realhost_info(hostname, ipaddress, section_name, max_cachefile_age, ignore_check_interval=True)
+    if rh_info != None:
+        info = apply_parse_function(add_nodeinfo(rh_info, section_name), section_name)
+    else:
+        info = None
+    if info != None and section_name in check_info and check_info[section_name]["extra_sections"]:
         info = [ info ]
         for es in check_info[section_name]["extra_sections"]:
             try:



More information about the checkmk-commits mailing list