Module: check_mk
Branch: master
Commit: 669376cf310e906aa4c15d994a2e973d7f1c1cf3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=669376cf310e90…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jul 26 09:36:36 2018 +0200
6369 FIX Fixed date shown for the first inventory history entry
Instead of showing 01.01.1970 for the first inventory history entry
the view now shows the correct inventory time again. This regression
affects all previous 1.5 releases
Change-Id: Iefb7fe9544c62348c92237886038bf14d1f99009
---
.werks/6369 | 13 +++++++++++++
cmk/gui/inventory.py | 5 +++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/6369 b/.werks/6369
new file mode 100644
index 0000000..1c381c5
--- /dev/null
+++ b/.werks/6369
@@ -0,0 +1,13 @@
+Title: Fixed date shown for the first inventory history entry
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1532590520
+
+Instead of showing 01.01.1970 for the first inventory history entry
+the view now shows the correct inventory time again. This regression
+affects all previous 1.5 releases
diff --git a/cmk/gui/inventory.py b/cmk/gui/inventory.py
index fe0e5de..b8464a3 100644
--- a/cmk/gui/inventory.py
+++ b/cmk/gui/inventory.py
@@ -182,13 +182,14 @@ def get_history(hostname):
comparable_trees = []
previous = None
- for this_timestamp, inventory_tree in sorted(history, key=lambda x: x[0],
reverse=True):
+ for this_timestamp, inventory_tree in sorted(history, key=lambda x: x[0]):
if previous is None:
previous = inventory_tree
else:
comparable_trees.append((this_timestamp, inventory_tree, previous))
previous = inventory_tree
- return comparable_trees
+
+ return reversed(comparable_trees)
def parent_path(invpath):