mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Catch EmptyResult exception in update_idranges
If no results are returned then find_entries will raise EmptyResult and not NotFound. NotFound is returned if the search base doesn't exist. The test for not entries can be removed as well since this is the EmptyResult case. In case of a NotFound this will be handled by the ExecutionError clause. Found with https://pagure.io/freeipa/issue/8555 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
parent
f86250a9a5
commit
69b42f0c80
@ -51,7 +51,7 @@ class update_idrange_type(Updater):
|
||||
(entries, truncated) = ldap.find_entries(search_filter,
|
||||
['objectclass'], base_dn, time_limit=0, size_limit=0)
|
||||
|
||||
except errors.NotFound:
|
||||
except errors.EmptyResult:
|
||||
logger.debug("update_idrange_type: no ID range without "
|
||||
"type set found")
|
||||
return False, []
|
||||
@ -61,11 +61,6 @@ class update_idrange_type(Updater):
|
||||
"of ranges with no type set: %s", e)
|
||||
return False, []
|
||||
|
||||
if not entries:
|
||||
# No entry was returned, rather break than continue cycling
|
||||
logger.debug("update_idrange_type: no ID range was returned")
|
||||
return False, []
|
||||
|
||||
logger.debug("update_idrange_type: found %d "
|
||||
"idranges to update, truncated: %s",
|
||||
len(entries), truncated)
|
||||
|
Loading…
Reference in New Issue
Block a user