Module: check_mk
Branch: master
Commit: 123614ee27195ff2ba60c7eaced950ee531d120f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=123614ee27195f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jun 19 07:30:10 2017 +0200
Removed deprecated is_multisite() noop calls
Change-Id: I593a37513376bf32fadac45ae6111f92d9b4af01
---
web/htdocs/config.py | 5 ----
web/htdocs/views.py | 2 +-
web/plugins/sidebar/shipped.py | 65 +++++++++++++++++++++---------------------
web/plugins/visuals/filters.py | 4 ---
4 files changed, 33 insertions(+), 43 deletions(-)
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 0f9a103..82f7f0d 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -700,11 +700,6 @@ def default_site():
return None
-
-def is_multisite():
- # TODO: Remove all calls of this function
- return True
-
def is_single_local_site():
if len(sites) > 1:
return False
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 8b2aba3..c0eca62 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1905,7 +1905,7 @@ def render_view(view, rows, datasource, group_painters, painters,
# In case of the web service we show errors only on single site installations.
if config.show_livestatus_errors \
and display_options.enabled(display_options.W) \
- and (html.output_format == "html" or not config.is_multisite()):
+ and html.output_format == "html":
for sitename, info in sites.live().dead_sites().items():
html.show_error("<b>%s - %s</b><br>%s" %
(info["site"]["alias"], _('Livestatus
error'), info["exception"]))
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index 2c56c72..c93ddd2 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -479,47 +479,46 @@ table.hostmatrix td { border: 1px solid #123a4a; padding: 0;
border-spacing: 0;
# '----------------------------------------------------------------------'
def render_sitestatus():
- if config.is_multisite():
- html.open_table(cellspacing=0, class_="sitestate")
+ html.open_table(cellspacing=0, class_="sitestate")
- sites.update_site_states_from_dead_sites()
+ sites.update_site_states_from_dead_sites()
- for sitename, sitealias in config.sorted_sites():
- site = config.site(sitename)
+ for sitename, sitealias in config.sorted_sites():
+ site = config.site(sitename)
- state = sites.state(sitename, {})
+ state = sites.state(sitename, {})
- if state.get("state") == None:
- state = "missing"
- text = _("Missing site")
- title = _("Site %s does not exist") % sitename
+ if state.get("state") == None:
+ state = "missing"
+ text = _("Missing site")
+ title = _("Site %s does not exist") % sitename
+ else:
+ if state["state"] == "disabled":
+ switch = "on"
+ text = site["alias"]
+ title = _("Site %s is switched off") % site["alias"]
else:
- if state["state"] == "disabled":
- switch = "on"
- text = site["alias"]
- title = _("Site %s is switched off") %
site["alias"]
- else:
- switch = "off"
- text = render_link(site["alias"],
"view.py?view_name=sitehosts&site=%s" % sitename)
- ex = state.get("exception")
- shs = state.get("status_host_state")
+ switch = "off"
+ text = render_link(site["alias"],
"view.py?view_name=sitehosts&site=%s" % sitename)
+ ex = state.get("exception")
+ shs = state.get("status_host_state")
- if ex:
- title = ex
- else:
- title = "Site %s is online" % site["alias"]
+ if ex:
+ title = ex
+ else:
+ title = "Site %s is online" % site["alias"]
- html.open_tr()
- html.open_td(class_="left")
- html.write(text)
- html.close_td()
- html.open_td(class_="state")
- html.status_label_button(content=state["state"],
status=state["state"],
- help=_("%s this site") % (state["state"] ==
"disabled" and _("enable") or _("disable")),
- onclick="switch_site('_site_switch=%s:%s')" %
(sitename, switch))
- html.close_tr()
- html.close_table()
+ html.open_tr()
+ html.open_td(class_="left")
+ html.write(text)
+ html.close_td()
+ html.open_td(class_="state")
+ html.status_label_button(content=state["state"],
status=state["state"],
+ help=_("%s this site") % (state["state"] ==
"disabled" and _("enable") or _("disable")),
+ onclick="switch_site('_site_switch=%s:%s')" % (sitename,
switch))
+ html.close_tr()
+ html.close_table()
sidebar_snapins["sitestatus"] = {
diff --git a/web/plugins/visuals/filters.py b/web/plugins/visuals/filters.py
index 644a77a..77da0b8 100644
--- a/web/plugins/visuals/filters.py
+++ b/web/plugins/visuals/filters.py
@@ -690,10 +690,6 @@ class FilterSite(Filter):
self.enforce = enforce
- def visible(self):
- return config.is_multisite()
-
-
def display(self):
html.dropdown("site", self._choices())