Module: check_mk
Branch: master
Commit: 5277bfde95ce829b699537c34505d72d8aba96e5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5277bfde95ce82…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 17 15:16:02 2016 +0100
Inventory: Cleaned up some install dates not to contain empty string but None
---
inventory/win_exefiles | 2 +-
inventory/win_reg_uninstall | 4 +++-
inventory/win_wmi_software | 4 +++-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/inventory/win_exefiles b/inventory/win_exefiles
index 155633a..d9a1641 100644
--- a/inventory/win_exefiles
+++ b/inventory/win_exefiles
@@ -51,7 +51,7 @@ def inv_win_exefiles(info):
# This is the 1.2.6p1 new default date
install_date = int(time.mktime(time.strptime(write_time, "%m/%d/%Y
%H:%M:%S")))
else:
- install_date = None # need to return 0 to not break the painter which assumes
an int
+ install_date = None
entry = {
"name" : parts[-1],
diff --git a/inventory/win_reg_uninstall b/inventory/win_reg_uninstall
index 2e70909..903389d 100644
--- a/inventory/win_reg_uninstall
+++ b/inventory/win_reg_uninstall
@@ -38,9 +38,11 @@ def inv_win_reg_uninstall(info):
display_name, publisher, path, pacname, version, estimated_size, date,
language = line
else:
continue
- install_date = ""
+
+ install_date = None
if re.match("^20\d{6}", date):
install_date = int(time.mktime(time.strptime(date, "%Y%m%d")))
+
size = saveint(estimated_size)
if size == 0:
size = None
diff --git a/inventory/win_wmi_software b/inventory/win_wmi_software
index 56d8fe7..1140c71 100644
--- a/inventory/win_wmi_software
+++ b/inventory/win_wmi_software
@@ -39,9 +39,11 @@ def inv_win_wmi_software(info):
for line in info:
pacname, vendor, version = line[0:3]
dat = line[3]
- install_date = ""
+
+ 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]