cannatag/ldap3

Ignore servers in pool with invalid credentials

Opened this issue · 0 comments

I am creating a pool with a list of servers that I get from my company's DNS, I am getting some servers for which my credentials are not valid. Is there any way I can instruct ldap3 to not raise and exception for this situation and just exclude the servers from the pool? This is the code that is failing:

    with contextlib.ExitStack() as stack:
        server_pools = {domain: ServerPool(servers, ROUND_ROBIN, active=True, exhaust=True) for domain, servers in SERVERS.items()}
        conns = {domain: stack.enter_context(Connection(pool, authentication=SASL, sasl_mechanism=KERBEROS)) for domain, pool in server_pools.items()}