From 651e1a1a6c498ccdb852f1d537baf55bdc79f6bb Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 2 Dec 2022 12:09:40 +0100 Subject: [PATCH] ldap: Work-arround with AD invalid return on searching objects --- mylib/ldap.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mylib/ldap.py b/mylib/ldap.py index 2bf9079..20425f1 100644 --- a/mylib/ldap.py +++ b/mylib/ldap.py @@ -581,6 +581,9 @@ class LdapClient: objects = {} for obj_dn, obj_attrs in ldap_data.items(): + # Ignore invalid result (view with an AD) + if not obj_dn or not isinstance(obj_attrs, dict): + continue objects[obj_dn] = self._get_obj(obj_dn, obj_attrs) self._cached_objects[name] = objects if not key_attr or key_attr == 'dn':