From e9bd8dee3b0350c08d16d57bfd008a72cb283c48 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Tue, 28 Aug 2007 16:01:07 -0700 Subject: 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. --- ipa-python/ipaclient.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ipa-python/ipaclient.py') diff --git a/ipa-python/ipaclient.py b/ipa-python/ipaclient.py index 9fd51db36..fcfb29f1d 100644 --- a/ipa-python/ipaclient.py +++ b/ipa-python/ipaclient.py @@ -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)) -- cgit