ldap: do not crash on timeout in get_ldap_group_dns (#54405)

This commit is contained in:
Valentin Deniaud 2021-06-03 11:49:01 +02:00
parent b961ec9180
commit 4eb5e4b74c
1 changed files with 2 additions and 0 deletions

View File

@ -1008,6 +1008,8 @@ class LDAPBackend(object):
results = self.normalize_ldap_results(results)
except ldap.NO_SUCH_OBJECT:
pass
except ldap.TIMEOUT:
log.error('connection timed out while retrieving group DNs')
else:
group_dns.update(dn for dn, attrs in results)
return group_dns