Module: check_mk
Branch: master
Commit: f2ab5c3ff72c01a510714a8f018ea058135603c9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f2ab5c3ff72c01…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Sep 21 11:36:35 2016 +0200
3811 FIX HW/SW Inventory: Fixed GUI display crash when querying data from older software
versions
Older software (livestatus) versions did not provide sufficient inventory data.
The crash happened when a site with a newer software version tried to query
data from a site running an older version.
---
.werks/3811 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/inventory.py | 8 ++++++++
3 files changed, 22 insertions(+)
diff --git a/.werks/3811 b/.werks/3811
new file mode 100644
index 0000000..090bef1
--- /dev/null
+++ b/.werks/3811
@@ -0,0 +1,13 @@
+Title: HW/SW Inventory: Fixed GUI display crash when querying data from older software
versions
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1474450273
+
+Older software (livestatus) versions did not provide sufficient inventory data.
+
+The crash happened when a site with a newer software version tried to query
+data from a site running an older version.
diff --git a/ChangeLog b/ChangeLog
index f309aa3..0dc1fd3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -726,6 +726,7 @@
* 3455 FIX: Fixed broken switch port filtering/sorting view
* 3663 FIX: Added missing system manufacturer filter/painter
* 3664 FIX: Fixed not working hardware/system serial and model painters and
filters...
+ * 3811 FIX: HW/SW Inventory: Fixed GUI display crash when querying data from older
software versions...
1.2.8b1:
diff --git a/web/htdocs/inventory.py b/web/htdocs/inventory.py
index 5f9a6ba..a13efb2 100644
--- a/web/htdocs/inventory.py
+++ b/web/htdocs/inventory.py
@@ -135,6 +135,14 @@ def get(tree, path):
path = path[1:]
node = tree
+
+ # The root node of the tree MUST be dictionary
+ # This info is taken from the host_inventory column in a livestatus table
+ # Older versions, which do not know this column, report None as fallback value
+ # This workaround prevents the inevitable crash
+ if node == None:
+ node = {}
+
current_what = "."
while path not in ('.', ':', ''):
parts = re.split("[:.]", path)