Change LDAP errors into debug statements to reduce log clutter

Fixes #2083
This commit is contained in:
Joseph Schorr 2016-11-10 16:39:26 -05:00
parent a4fce1b102
commit 536809a992

View file

@ -107,11 +107,11 @@ class LDAPUsers(FederatedUsers):
subquery = u'(%s=%s)' % (self._uid_attr, username_or_email)
return (conn.search_s(referral_dn, ldap.SCOPE_BASE, subquery), None)
except ldap.LDAPError:
logger.exception('LDAP referral search exception')
logger.debug('LDAP referral search exception')
return (None, 'Username not found')
except ldap.LDAPError:
logger.exception('LDAP search exception')
logger.debug('LDAP search exception')
return (None, 'Username not found')
def _ldap_user_search(self, username_or_email, limit=20):
@ -234,11 +234,11 @@ class LDAPUsers(FederatedUsers):
self._allow_tls_fallback):
pass
except ldap.INVALID_CREDENTIALS:
logger.exception('Invalid LDAP credentials')
logger.debug('Invalid LDAP credentials')
return (None, 'Invalid password')
except ldap.INVALID_CREDENTIALS:
logger.exception('Invalid LDAP credentials')
logger.debug('Invalid LDAP credentials')
return (None, 'Invalid password')
return self._credential_for_user(found_response)