Module: check_mk
Branch: master
Commit: 7559a2729980deb552ae36d6735c7aad691c24d0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7559a2729980de…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Dec 6 10:07:19 2018 +0100
6821 FIX HW/SW Inventory history: Display the whole row if there are any changes
Change-Id: I8d860bdf4ee00821504314ec764a8fa744b659d7
---
.werks/6821 | 21 +++++++++++++++++++++
cmk/structured_data.py | 8 ++++----
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/.werks/6821 b/.werks/6821
new file mode 100644
index 0000000..fdbde18
--- /dev/null
+++ b/.werks/6821
@@ -0,0 +1,21 @@
+Title: HW/SW Inventory history: Display the whole row if there are any changes
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1544087188
+
+The HW/SW Inventory history shows new, changed or removed entries. If there are
+changed entries in one row in a list Check_MK version 1.5.0p9 only shows these
+changes. This is a regression because the previous stable version 1.4.0
+displayed not only the changed entries, but also the unchanged entries in order
+to refer to the right row.
+
+Example:
+Check_MK 1.4.0 displays all entries of a changed row in the package list:
+{{libtiff5, 4.0.8, x86_64, deb, 2+deb9u2 -> 2+deb9u4}}
+
+but Check_MK 1.5.0p9 only shows {{2+deb9u2 -> 2+deb9u4}}.
diff --git a/cmk/structured_data.py b/cmk/structured_data.py
index 43f96fa..ed1e5ab 100644
--- a/cmk/structured_data.py
+++ b/cmk/structured_data.py
@@ -748,7 +748,7 @@ class Numeration(Leaf):
# In this case we assume that each entry corresponds to the
# other one with the same index.
num_new, num_changed, num_removed = 0, 0, 0
- data = []
+ compared_rows = []
for own_row, other_row in zip(own_rows, other_rows):
new_entries, changed_entries, removed_entries, identical_entries = \
_compare_dicts(other_row, own_row)
@@ -758,11 +758,11 @@ class Numeration(Leaf):
row = {}
for entries in [new_entries, changed_entries, removed_entries]:
row.update(entries)
- if keep_identical:
+ if keep_identical or new_entries or changed_entries or removed_entries:
row.update(identical_entries)
if row:
- data.append(row)
- return num_new, num_changed, num_removed, data
+ compared_rows.append(row)
+ return num_new, num_changed, num_removed, compared_rows
def encode_for_delta_tree(self, encode_as):
delta_node = Numeration()