[checkmk-commits] Check_MK Git: check_mk: win_exefiles: Fix exception when agent sends broken lines

Mathias Kettner mk at mathias-kettner.de
Mon Apr 20 14:49:33 CEST 2015


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

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Mon Apr 20 14:49:30 2015 +0200

win_exefiles: Fix exception when agent sends broken lines

---

 inventory/win_exefiles |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/inventory/win_exefiles b/inventory/win_exefiles
index 6c3401b..4332504 100644
--- a/inventory/win_exefiles
+++ b/inventory/win_exefiles
@@ -33,7 +33,10 @@
 
 def inv_win_exefiles(info):
     paclist = inv_tree("software.packages:")
-    for full_name, write_time, size, description, product_version, product_name in info:
+    for line in info:
+        if len(line) != 6:
+            continue # ignore broken lines containing parse errors
+        full_name, write_time, size, description, product_version, product_name = line
         parts = full_name.split('\\')
         # Since 1.2.6p1 the agent always provides a date format of "04/18/2003 18:06:32".
         # Old agent versions provided localized date formats which lead to problems here



More information about the checkmk-commits mailing list