Module: check_mk
Branch: master
Commit: 2417b4c8db1c29b45b08ff984381c6980bf4f1a9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2417b4c8db1c29…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 25 11:26:28 2017 +0200
Improved exception handing in master control snapin
Change-Id: Ic798885306833c808405db41c26091fc360b250e
---
web/plugins/sidebar/shipped.py | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index 5bf42a1..6c0732a 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -1320,10 +1320,7 @@ def render_master_control():
finally:
sites.live().set_prepend_site(False)
- for site_id, site_alias in config.sorted_sites():
- if not config.is_single_local_site():
- html.begin_foldable_container("master_control", site_id, True,
site_alias)
-
+ def _render_master_control_site(site_id):
site_state = sites.state(site_id)
if site_state["state"] == "dead":
html.show_error(site_state["exception"])
@@ -1361,8 +1358,18 @@ def render_master_control():
html.close_table()
+ for site_id, site_alias in config.sorted_sites():
if not config.is_single_local_site():
- html.end_foldable_container()
+ html.begin_foldable_container("master_control", site_id, True,
site_alias)
+
+ try:
+ _render_master_control_site(site_id)
+ except Exception, e:
+ log_exception()
+ write_snapin_exception(e)
+ finally:
+ if not config.is_single_local_site():
+ html.end_foldable_container()
sidebar_snapins["master_control"] = {