Module: check_mk
Branch: master
Commit: ec5c0ccb3fd0fa4765f5b2e0cbfaa9db6202324d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ec5c0ccb3fd0fa…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed May 20 14:50:46 2015 +0200
#2295 FIX Fix exception in reporting for views that do not show a host name
---
.werks/2295 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 9 +++++++--
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/.werks/2295 b/.werks/2295
new file mode 100644
index 0000000..d911ed7
--- /dev/null
+++ b/.werks/2295
@@ -0,0 +1,10 @@
+Title: Fix exception in reporting for views that do not show a host name
+Level: 1
+Component: reporting
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1432126221
+
+
diff --git a/ChangeLog b/ChangeLog
index 645229f..0a6494f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -542,6 +542,7 @@
* 1990 FIX: Fix two exceptions in PDF exports of host group views
* 2189 FIX: Allow changing graph number from 1 to "all" when editing PNP
graph in report...
* 2206 FIX: Add missing option "Show timeline of each object directly in
table" for reports...
+ * 2295 FIX: Fix exception in reporting for views that do not show a host name
Event Console:
* 1845 Keep record of original source IP address of a syslog message or SNMP trap...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index e140c36..f26fef7 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -971,6 +971,10 @@ def show_view(view, show_heading = False, show_buttons = True,
need_inventory_data = False
# Prepare Filter headers for Livestatus
+ # TODO: When this is used by the reporting then *all* filters are
+ # active. That way the inventory data will always be loaded. When
+ # we convert this to the visuals principle the we need to optimize
+ # this.
filterheaders = ""
only_sites = None
all_active_filters = [ f for f in use_filters if f.available() ]
@@ -1080,10 +1084,11 @@ def show_view(view, show_heading = False, show_buttons = True,
if len(join_painters) > 0:
do_table_join(datasource, rows, filterheaders, join_painters, join_columns,
only_sites)
- # Add inventory data if one of the painters needs it
+ # Add inventory data if one of the painters or filters needs it
if need_inventory_data:
for row in rows:
- row["host_inventory"] =
inventory.host(row["host_name"])
+ if "host_name" in row:
+ row["host_inventory"] =
inventory.host(row["host_name"])
sort_data(rows, sorters)
else: