ldap: differentiate errors during bind (#51353)
This commit is contained in:
parent
8df0d97988
commit
9a4ab69f22
|
@ -1471,8 +1471,12 @@ class LDAPBackend(object):
|
|||
return False, u'invalid credentials'
|
||||
except ldap.INVALID_DN_SYNTAX:
|
||||
return False, u'invalid dn syntax %s' % who
|
||||
except (ldap.TIMEOUT, ldap.CONNECT_ERROR, ldap.SERVER_DOWN):
|
||||
return False, u'ldap is down'
|
||||
except ldap.CONNECT_ERROR:
|
||||
return False, 'connection error'
|
||||
except ldap.TIMEOUT:
|
||||
return False, 'timeout'
|
||||
except ldap.SERVER_DOWN:
|
||||
return False, 'ldap is down'
|
||||
|
||||
@classmethod
|
||||
def get_connection(cls, block, credentials=()):
|
||||
|
|
Loading…
Reference in New Issue