mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-11-02 20:30:26 -06:00
baseldap: Handle missing parent objects properly in *-find commands
The find_entries function in ipaldap does not differentiate between a LDAP search that returns error code 32 (No such object) and LDAP search returning error code 0 (Success), but returning no results. In both cases errors.NotFound is raised. In turn, LDAPSearch commands interpret NotFound exception as no results. To differentiate between the cases, a new error EmptyResult was added, which inherits from NotFound to preserve the compatibility with the new code. This error is raised by ipaldap.find_entries in case it is performing a search with and the target dn does not exist. https://fedorahosted.org/freeipa/ticket/4659 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
1 parent
b6c58ff238
commit
e11e8235ac
3 files changed
+19
-2
No files matched your search
@@ -1527,7 +1527,7 @@ class LDAPClient(object):
|
||||
break
|
||||
|
||||
if not res and not truncated:
|
||||
raise errors.NotFound(reason='no such entry')
|
||||
raise errors.EmptyResult(reason='no matching entry found')
|
||||
|
||||
return (res, truncated)
|
||||
|
||||
|
||||
Reference in new issue
Block a user