Module: check_mk
Branch: master
Commit: b928b7108608531bc871eb07ced79347a3e1862a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b928b710860853…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jan 2 10:59:06 2013 +0100
ldap: More detailed exception text in case of connection errors
---
web/plugins/userdb/ldap.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 7c57aec..5d7b6fa 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -141,9 +141,10 @@ def ldap_connect():
# on success, store the connection options the connection has been made with
ldap_connection_options = config.ldap_connection
- except ldap.SERVER_DOWN:
+ except ldap.SERVER_DOWN, e:
+ msg = e[0].get('info', e[0].get('desc', ''))
ldap_connection = None # Invalidate connection on failure
- raise MKLDAPException(_('The LDAP connector is unable to connect to the LDAP
server.'))
+ raise MKLDAPException(_('The LDAP connector is unable to connect to the LDAP
server (%s).') % msg)
except ldap.LDAPError, e:
html.write(repr(e))