def ldap(self):
# Connect to LDAP server
ldap_uri = self.settings.get("ldap_uri")
- conn = ldap.initialize(ldap_uri)
logging.debug("Connecting to LDAP server: %s" % ldap_uri)
+ # Connect to the LDAP server
+ conn = ldap.ldapobject.ReconnectLDAPObject(ldap_uri,
+ retry_max=10, retry_delay=3)
+
# Bind with username and password
bind_dn = self.settings.get("ldap_bind_dn")
if bind_dn: