Module: check_mk
Branch: master
Commit: b8b99e644dc7fdd486dfa84e8c9e185123b41987
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b8b99e644dc7fd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 2 14:15:23 2016 +0100
Graph dashlet: Fixed error handling in case a host can not be found
---
web/plugins/dashboard/dashlets.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/web/plugins/dashboard/dashlets.py b/web/plugins/dashboard/dashlets.py
index b61e29c..2331d77 100644
--- a/web/plugins/dashboard/dashlets.py
+++ b/web/plugins/dashboard/dashlets.py
@@ -351,7 +351,10 @@ def dashlet_graph_reload_js(nr, dashlet):
else:
html.live.set_prepend_site(True)
query = "GET hosts\nFilter: name = %s\nColumns: name" % lqencode(host)
- site = html.live.query_column(query)[0]
+ try:
+ site = html.live.query_column(query)[0]
+ except IndexError:
+ raise MKUserError("host", _("The host could not be found on
any active site."))
html.live.set_prepend_site(False)
# New graphs which have been added via "add to visual" option don't
have a timerange