Module: check_mk
Branch: master
Commit: d57654c0ff06f2228a77e01825ac233624fe3318
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d57654c0ff06f2…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Jan 25 12:50:32 2017 +0100
4302 FIX win_wmi_software: fixed invalid data handling
Change-Id: I6df20ca80218fc402c675d3786770b3fb4387e55
---
.werks/4302 | 10 ++++++++++
ChangeLog | 1 +
inventory/win_wmi_software | 13 ++++++++-----
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/.werks/4302 b/.werks/4302
new file mode 100644
index 0000000..f8dc676
--- /dev/null
+++ b/.werks/4302
@@ -0,0 +1,10 @@
+Title: win_wmi_software: fixed invalid data handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i4
+Date: 1485345009
+
+
diff --git a/ChangeLog b/ChangeLog
index 63bdde2..cd55277 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -66,6 +66,7 @@
* 4299 FIX: df: fixed missing filesystem type handling
* 4300 FIX: job: fixed missing information handling
* 4301 FIX: winperf_tcp_conn: fixed missing data handling
+ * 4302 FIX: win_wmi_software: fixed invalid data handling
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/inventory/win_wmi_software b/inventory/win_wmi_software
index 00a778b..3365111 100644
--- a/inventory/win_wmi_software
+++ b/inventory/win_wmi_software
@@ -37,17 +37,20 @@
def inv_win_wmi_software(info):
paclist = inv_tree_list("software.packages:")
for line in info:
- pacname, vendor, version = line[0:3]
+ if len(line) < 3:
+ continue
+
+ pacname, vendor, version = line[:3]
dat = line[3]
install_date = None
if len(dat) == 8 and re.match("^20", dat):
install_date = int(time.mktime(time.strptime(dat, "%Y%m%d")))
- # contains language as well
- if len(line) == 5:
- language = line[4]
- else:
+ # contains language as well
+ if len(line) == 5:
+ language = line[4]
+ else:
language = ""
entry = {