Module: check_mk
Branch: master
Commit: 7bd98f1f71e7c2cc08adc8f687f43923f98fbcfd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7bd98f1f71e7c2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 17 14:37:01 2016 +0100
ldap connection loading: Fixed invalid access to variable in exception handling
---
web/htdocs/sidebar.py | 2 +-
web/htdocs/userdb.py | 15 +++++++++------
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 6b5a515..b5d8d35 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -371,7 +371,7 @@ def render_snapin(name, state):
def snapin_exception(e):
if config.debug:
- raise
+ raise e
else:
html.write("<div class=snapinexception>\n"
"<h2>%s</h2>\n"
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index c783363..ac7c219 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -791,21 +791,24 @@ def declare_custom_user_attrs():
# '----------------------------------------------------------------------'
def load_connection_config():
+ user_connections = []
+
filename = multisite_dir + "user_connections.mk"
if not os.path.exists(filename):
- return []
+ return user_connections
+
try:
- vars = {
- "user_connections" : [],
+ context = {
+ "user_connections": user_connections,
}
- execfile(filename, vars, vars)
- return vars["user_connections"]
+ execfile(filename, context, context)
+ return context["user_connections"]
except Exception, e:
if config.debug:
raise MKGeneralException(_("Cannot read configuration file %s: %s"
%
(filename, e)))
- return vars["user_connections"]
+ return user_connections
def save_connection_config(connections):