diff options
author | Kevin McCarthy <kmccarth@redhat.com> | 2007-08-28 16:01:07 -0700 |
---|---|---|
committer | Kevin McCarthy <kmccarth@redhat.com> | 2007-08-28 16:01:07 -0700 |
commit | e9bd8dee3b0350c08d16d57bfd008a72cb283c48 (patch) | |
tree | f02ea70f613862f2e668bbdb691c25295d3aba20 /ipa-python | |
parent | ef2dc5cefa2f9ba94edea7cfce8913e3f25723bd (diff) | |
download | freeipa-e9bd8dee3b0350c08d16d57bfd008a72cb283c48.tar.gz freeipa-e9bd8dee3b0350c08d16d57bfd008a72cb283c48.tar.xz freeipa-e9bd8dee3b0350c08d16d57bfd008a72cb283c48.zip |
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.
Diffstat (limited to 'ipa-python')
-rw-r--r-- | ipa-python/ipaclient.py | 10 | ||||
-rw-r--r-- | ipa-python/rpcclient.py | 5 |
2 files changed, 9 insertions, 6 deletions
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)) diff --git a/ipa-python/rpcclient.py b/ipa-python/rpcclient.py index 7d41caee1..e0d6e2ee7 100644 --- a/ipa-python/rpcclient.py +++ b/ipa-python/rpcclient.py @@ -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: |