Module: check_mk
Branch: master
Commit: 17fd31635b3ecb418ca25a4153c5abfaaa93495a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=17fd31635b3ecb…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Sep 18 14:25:26 2018 +0200
6598 FIX HW/SW Inventory: Do not list plugins on commandline for which the related section
is empty
Change-Id: I0333452af31c77eefb8c58d4bf51636ead4d4197
---
.werks/6598 | 10 ++++++++++
cmk_base/inventory.py | 6 ++++++
2 files changed, 16 insertions(+)
diff --git a/.werks/6598 b/.werks/6598
new file mode 100644
index 0000000..023fce1
--- /dev/null
+++ b/.werks/6598
@@ -0,0 +1,10 @@
+Title: HW/SW Inventory: Do not list plugins on commandline for which the related section
is empty
+Level: 1
+Component: inv
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1537273423
+Class: fix
+
+
diff --git a/cmk_base/inventory.py b/cmk_base/inventory.py
index 6363a17..2c37116 100644
--- a/cmk_base/inventory.py
+++ b/cmk_base/inventory.py
@@ -249,6 +249,12 @@ def _do_inv_for_realhost(sources, multi_host_sections, hostname,
ipaddress,
# Note: this also excludes existing sections without info..
continue
+ if all([x in [[], {}, None] for x in section_content]):
+ # Inventory plugins which get parsed info from related
+ # check plugin may have more than one return value, eg
+ # parse function of oracle_tablespaces returns ({}, {})
+ continue
+
console.verbose(" %s%s%s%s" % (tty.green, tty.bold, section_name,
tty.normal))
# Inventory functions can optionally have a second argument: parameters.