summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-09-20 17:45:29 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-09-20 17:45:29 +0200
commit7d1e0aae9bbd1599968cf1ddd7a1b7ac04a7c9fa (patch)
tree42f3c099ab16157ba9a61fb5073cb2f5a8ab0bc1
parent63bec7484161ac5b002525f014d7f040e35cf353 (diff)
downloadpykolab-7d1e0aae9bbd1599968cf1ddd7a1b7ac04a7c9fa.tar.gz
Do not fail authentication should the authentication cache fail
-rw-r--r--pykolab/auth/ldap/__init__.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 042592b..1078525 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -169,7 +169,11 @@ class LDAP(pykolab.base.Base):
else:
base_dn = config_base_dn
- auth_cache.set_entry(self.domain, base_dn)
+ try:
+ auth_cache.set_entry(self.domain, base_dn)
+ except Exception, errmsg:
+ log.error(_("Authentication cache failed: %r") % (errmsg))
+ pass
user_filter = self.config_get_raw('user_filter') % ({'base_dn':base_dn})
@@ -216,7 +220,11 @@ class LDAP(pykolab.base.Base):
# to True!!
self.ldap.simple_bind_s(entry_dn, login[1])
retval = True
- auth_cache.set_entry(_filter, entry_dn)
+ try:
+ auth_cache.set_entry(_filter, entry_dn)
+ except Exception, errmsg:
+ log.error(_("Authentication cache failed: %r") % (errmsg))
+ pass
except:
try:
log.debug(