diff options
Diffstat (limited to 'ipapython/ipaldap.py')
-rw-r--r-- | ipapython/ipaldap.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py index 6873511c4..9ee0ab5f5 100644 --- a/ipapython/ipaldap.py +++ b/ipapython/ipaldap.py @@ -1164,7 +1164,7 @@ class LDAPClient(object): ) return self.combine_filters(flts, rules) - def get_entries(self, base_dn, scope=None, filter=None, attrs_list=None): + def get_entries(self, base_dn, scope=None, filter=None, attrs_list=None, debug=False): """Return a list of matching entries. Raises an error if the list is truncated by the server @@ -1177,14 +1177,14 @@ class LDAPClient(object): Use the find_entries method for more options. """ entries, truncated = self.find_entries( - base_dn=base_dn, scope=scope, filter=filter, attrs_list=attrs_list) + base_dn=base_dn, scope=scope, filter=filter, attrs_list=attrs_list, debug=debug) if truncated: raise errors.LimitsExceeded() return entries def find_entries(self, filter=None, attrs_list=None, base_dn=None, scope=ldap.SCOPE_SUBTREE, time_limit=None, - size_limit=None, search_refs=False): + size_limit=None, search_refs=False, debug=False): """ Return a list of entries and indication of whether the results were truncated ([(dn, entry_attrs)], truncated) matching specified search @@ -1232,14 +1232,20 @@ class LDAPClient(object): base_dn, scope, filter, attrs_list, timeout=time_limit, sizelimit=size_limit ) + if debug: + self.log.info("id: %s" % id) while True: (objtype, res_list) = self.conn.result(id, 0) + if debug: + self.log.info("res_list: %s" % res_list) if not res_list: break if (objtype == ldap.RES_SEARCH_ENTRY or (search_refs and objtype == ldap.RES_SEARCH_REFERENCE)): res.append(res_list[0]) + if debug: + self.log.info('appending to res: %s' % res_list[0]) except (ldap.ADMINLIMIT_EXCEEDED, ldap.TIMELIMIT_EXCEEDED, ldap.SIZELIMIT_EXCEEDED), e: truncated = True |