Module: check_mk
Branch: master
Commit: 6e7217c99cfc95f326777f9868f60ce6a824dafe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6e7217c99cfc95…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 4 14:09:30 2019 +0100
Simplify render_availability_page() arguments
Change-Id: Ic0e5be8cf9ebb63c3cf1ff461710698aaa158ae8
---
cmk/gui/plugins/views/availability.py | 10 +++++-----
cmk/gui/views.py | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/cmk/gui/plugins/views/availability.py
b/cmk/gui/plugins/views/availability.py
index a057f5f..6a91620 100644
--- a/cmk/gui/plugins/views/availability.py
+++ b/cmk/gui/plugins/views/availability.py
@@ -165,16 +165,16 @@ def render_availability_options(what):
# Render the page showing availability table or timelines. It
# is (currently) called by views.py, when showing a view but
# availability mode is activated.
-def render_availability_page(view, datasource, context, filterheaders, only_sites,
limit):
+def render_availability_page(view, context, filterheaders):
config.user.need_permission("general.see_availability")
if handle_edit_annotations():
return
# We make reports about hosts, services or BI aggregates
- if "service" in datasource.infos:
+ if "service" in view.datasource.infos:
what = "service"
- elif "aggr_name" in datasource.infos:
+ elif "aggr_name" in view.datasource.infos:
what = "bi"
else:
what = "host"
@@ -210,7 +210,7 @@ def render_availability_page(view, datasource, context, filterheaders,
only_site
title += av_object[2]
else:
av_object = None
- title += view_title(view)
+ title += view_title(view.spec)
# Deletion must take place before computation, since it affects the outcome
with html.plugged():
@@ -220,7 +220,7 @@ def render_availability_page(view, datasource, context, filterheaders,
only_site
# Now compute all data, we need this also for CSV export
if not html.has_user_errors():
av_rawdata, has_reached_logrow_limit = \
- availability.get_availability_rawdata(what, context, filterheaders,
only_sites,
+ availability.get_availability_rawdata(what, context, filterheaders,
view.only_sites,
av_object, av_mode ==
"timeline", avoptions)
av_data = availability.compute_availability(what, av_rawdata, avoptions)
diff --git a/cmk/gui/views.py b/cmk/gui/views.py
index d5b68b3..dc8158a 100644
--- a/cmk/gui/views.py
+++ b/cmk/gui/views.py
@@ -1241,7 +1241,7 @@ def show_view(view, view_renderer, only_count=False):
context.update(visuals.get_singlecontext_html_vars(view.spec))
return cmk.gui.plugins.views.availability.render_availability_page(
- view.spec, view.datasource, context, filterheaders, view.only_sites,
view.row_limit)
+ view, context, filterheaders)
query = filterheaders + view.spec.get("add_headers", "")