diff options
author | Rob Crittenden <rcritten@redhat.com> | 2010-08-18 14:04:58 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-08-19 10:51:55 -0400 |
commit | 110d46b79209b74c0081e0baffc90b0cfc9f3ba2 (patch) | |
tree | 79e4a0ff2c095e7edb6123a2bcafae937ab33698 /ipalib/plugins/baseldap.py | |
parent | 3e15e6ed6dd0fa6f5606fd77b5104fd067798cde (diff) | |
download | freeipa-110d46b79209b74c0081e0baffc90b0cfc9f3ba2.tar.gz freeipa-110d46b79209b74c0081e0baffc90b0cfc9f3ba2.tar.xz freeipa-110d46b79209b74c0081e0baffc90b0cfc9f3ba2.zip |
Use global time and size limit values when searching.
Add test to verify that limit is honored and truncated flag set.
ticket #48
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r-- | ipalib/plugins/baseldap.py | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 69bda6d81..1757a452e 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -829,21 +829,19 @@ class LDAPSearch(CallbackInterface, crud.Search): Retrieve all LDAP entries matching the given criteria. """ takes_options = ( - Int('timelimit', + Int('timelimit?', label=_('Time Limit'), - doc=_('Time limit of search in seconds (default 1)'), - flags=['no_dispaly'], + doc=_('Time limit of search in seconds'), + flags=['no_display'], minvalue=0, - default=1, - autofill=True, + autofill=False, ), - Int('sizelimit', + Int('sizelimit?', label=_('Size Limit'), - doc=_('Maximum number of entries returned (default 3000)'), - flags=['no_dispaly'], + doc=_('Maximum number of entries returned'), + flags=['no_display'], minvalue=0, - default=3000, - autofill=True, + autofill=False, ), ) @@ -911,8 +909,8 @@ class LDAPSearch(CallbackInterface, crud.Search): try: (entries, truncated) = ldap.find_entries( filter, attrs_list, base_dn, scope=ldap.SCOPE_ONELEVEL, - time_limit=options.get('timelimit', 1), - size_limit=options.get('sizelimit', 3000) + time_limit=options.get('timelimit', None), + size_limit=options.get('sizelimit', None) ) except errors.ExecutionError, e: try: |