Module: check_mk
Branch: master
Commit: 3f5465a989db640aabd002f1e8057c5c7d4b0cd7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3f5465a989db64…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Oct 8 11:21:09 2014 +0200
Fix exception when a visual has no context
---
web/htdocs/visuals.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py
index d31b991..689875b 100644
--- a/web/htdocs/visuals.py
+++ b/web/htdocs/visuals.py
@@ -898,7 +898,7 @@ def add_context_to_uri_vars(visual, only_infos=None, only_count=False):
# Now apply the multiple context filters
for info_key in only_infos:
- for filter_name, filter_vars in visual['context'].items():
+ for filter_name, filter_vars in visual.get('context', {}).items():
if type(filter_vars) == dict: # this is a multi-context filter
# We add the filter only if *none* if its HTML variables are present on the URL
# This important because checkbox variables are not present if the box is not checked.
Module: check_mk
Branch: master
Commit: 4c32dd7525a021f90bae13346727dcfa86b87ef2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4c32dd7525a021…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Oct 8 09:59:42 2014 +0200
views: allow specifying limit when calling show_view()
---
web/htdocs/views.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 7e276d6..ed7778d 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -845,7 +845,7 @@ def prepare_display_options():
# is about.
def show_view(view, show_heading = False, show_buttons = True,
show_footer = True, render_function = None, only_count=False,
- all_filters_active=False):
+ all_filters_active=False, limit=None):
if html.var("mode") == "availability" and html.has_var("av_aggr_name") and html.var("timeline"):
bi.page_timeline()
return
@@ -899,9 +899,9 @@ def show_view(view, show_heading = False, show_buttons = True,
# the limit was not applied on the resulting rows but on the
# lines of the log processed. This resulted in wrong stats.
# For these datasources we ignore the query limits.
- limit = None
- if not datasource.get('ignore_limit', False):
- limit = get_limit()
+ if limit == None: # Otherwise: specified as argument
+ if not datasource.get('ignore_limit', False):
+ limit = get_limit()
# Fork to availability view. We just need the filter headers, since we do not query the normal
# hosts and service table, but "statehist". This is *not* true for BI availability, though (see later)