summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2018-01-24 10:56:39 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2018-01-24 10:56:39 +0100
commit89e588c3954f46bd6d278443c5e07af66a120052 (patch)
tree9cc1b500d56a1d3e11a511ab0299c795cdd9963a
parent7ee0bb402496617426d8ad0cfe5d99915ac943f5 (diff)
downloadpykolab-89e588c3954f46bd6d278443c5e07af66a120052.tar.gz
Include what we fail on, when we fail on something
-rw-r--r--pykolab/auth/ldap/__init__.py31
1 files changed, 27 insertions, 4 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 622df71..f2d2738 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -1435,8 +1435,13 @@ class LDAP(pykolab.base.Base):
bind_pw = self.config_get('service_bind_pw')
if bind_dn is not None:
- log.debug(_("Binding with bind_dn: %s and password: %s")
- % (bind_dn, '*' * len(bind_pw)))
+ log.debug(
+ _("Binding with bind_dn: %s and password: %s") % (
+ bind_dn,
+ '*' * len(bind_pw)
+ ),
+ level=8
+ )
# TODO: Binding errors control
try:
@@ -1452,8 +1457,21 @@ class LDAP(pykolab.base.Base):
return False
+ except ldap.NO_SUCH_OBJECT:
+ log.error(
+ _("Invalid DN, username and/or password for '%s'.") % (
+ bind_dn
+ )
+ )
+
+ return False
+
except ldap.INVALID_CREDENTIALS:
- log.error(_("Invalid DN, username and/or password."))
+ log.error(
+ _("Invalid DN, username and/or password for '%s'.") % (
+ bind_dn
+ )
+ )
return False
@@ -1477,7 +1495,12 @@ class LDAP(pykolab.base.Base):
log.error(_("%s") % (traceback.format_exc()))
return False
except ldap.INVALID_CREDENTIALS:
- log.error(_("Invalid DN, username and/or password."))
+ log.error(
+ _("Invalid DN, username and/or password for '%s'.") % (
+ bind_dn
+ )
+ )
+
return False
else:
log.debug(_("bind_priv() called but already bound"), level=8)