mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Change user search to be asynchronous.
This way it returns results even if the search times out. The find_users() search now returns a counter as the first result, which is set to -1 if the results are partial.
This commit is contained in:
@@ -94,12 +94,14 @@ class IPAClient:
|
||||
return result
|
||||
|
||||
def find_users(self, criteria, sattrs=None):
|
||||
"""Find users whose uid matches the criteria. Wildcards are
|
||||
acceptable. Returns a list of User objects."""
|
||||
"""Return a list: counter followed by a User object for each user that
|
||||
matches the criteria. If the results are truncated, counter will
|
||||
be set to -1"""
|
||||
result = self.transport.find_users(criteria, sattrs)
|
||||
counter = result[0]
|
||||
|
||||
users = []
|
||||
for attrs in result:
|
||||
users = [counter]
|
||||
for attrs in result[1:]:
|
||||
if attrs is not None:
|
||||
users.append(user.User(attrs))
|
||||
|
||||
|
||||
@@ -151,8 +151,9 @@ class RPCClient:
|
||||
return ipautil.unwrap_binary_data(result)
|
||||
|
||||
def find_users (self, criteria, sattrs=None):
|
||||
"""Return a list containing a User object for each user that matches
|
||||
the criteria."""
|
||||
"""Return a list: counter followed by a User object for each user that
|
||||
matches the criteria. If the results are truncated, counter will
|
||||
be set to -1"""
|
||||
|
||||
server = self.setup_server()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user