Module: check_mk
Branch: master
Commit: 271d610d62e4884aa4ad26aaaf45a5e2ebd6340f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=271d610d62e488…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Feb 22 20:24:56 2012 +0100
Replicated WATO/automation: load plugins in index.py!
---
web/htdocs/index.py | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index 6cffb43..42e7c03 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -157,6 +157,16 @@ def connect_to_livestatus(html):
# Default auth domain is read. Please set to None to switch off authorization
html.live.set_auth_domain('read')
+# Call the load_plugins() function in all modules
+def load_all_plugins():
+ for module in [ views, sidebar, dashboard, wato, bi, mobile ]:
+ try:
+ module.load_plugins # just check if this function exists
+ module.load_plugins()
+ except AttributeError:
+ pass
+ except Exception:
+ raise
# Main entry point for all HTTP-requests (called directly by mod_apache)
def handler(req, profiling = True):
@@ -222,6 +232,7 @@ def handler(req, profiling = True):
# here. Automation calls bybass the normal authentication stuff
if req.myfile == "automation":
try:
+ load_all_plugins()
handler()
except Exception, e:
html.write(str(e))
@@ -265,15 +276,7 @@ def handler(req, profiling = True):
load_language(html.var("lang", config.get_language()))
# All plugins might have to be reloaded due to a language change
- # FIXME: Hier werden alle Module geladen, obwohl diese gar nicht immer alle
benötigt würden
- for module in [ views, sidebar, dashboard, wato, bi, mobile ]:
- try:
- module.load_plugins # just check if this function exists
- module.load_plugins()
- except AttributeError:
- pass
- except Exception:
- raise
+ load_all_plugins()
# User allowed to login at all?
if not config.may("use"):