Re: [Freeipa-devel] [PATCH] Add new parameters to LDAPSearch: timelimit and sizelimit.

2010-08-12 Thread Rob Crittenden

Rob Crittenden wrote:

Pavel Zůna wrote:

Doesn't include Robs loading of default values from cn=ipaConfig.

Pavel



ack for now.

We're going to need to remove the built-in defaults at some point and
have it default to the value in cn=ipaconfig. I still need to rework the
patch I made that does this.

rob


pushed to master

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

[Freeipa-devel] [PATCH] Add new parameters to LDAPSearch: timelimit and sizelimit.

2010-08-09 Thread Pavel Zůna

Doesn't include Robs loading of default values from cn=ipaConfig.

Pavel
From a81e2b42d16473b0102969246dcf81820b1930f0 Mon Sep 17 00:00:00 2001
From: Pavel Zuna pz...@redhat.com
Date: Mon, 9 Aug 2010 19:56:14 -0400
Subject: [PATCH 4/4] Add new parameters to LDAPSearch: timelimit and sizelimit.

---
 ipalib/plugins/baseldap.py |   25 +++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index abc1180..7e2fd4f 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -25,7 +25,7 @@ import json
 
 from ipalib import crud, errors, uuid
 from ipalib import Method, Object
-from ipalib import Flag, List, Str
+from ipalib import Flag, Int, List, Str
 from ipalib.base import NameSpace
 from ipalib.cli import to_cli, from_cli
 from ipalib import output
@@ -827,6 +827,25 @@ class LDAPSearch(CallbackInterface, crud.Search):
 
 Retrieve all LDAP entries matching the given criteria.
 
+takes_options = (
+Int('timelimit',
+label=_('Time Limit'),
+doc=_('Time limit of search in seconds (default 1)'),
+flags=['no_dispaly'],
+minvalue=0,
+default=1,
+autofill=True,
+),
+Int('sizelimit',
+label=_('Size Limit'),
+doc=_('Maximum number of entries returned (default 3000)'),
+flags=['no_dispaly'],
+minvalue=0,
+default=3000,
+autofill=True,
+),
+)
+
 def get_args(self):
 for key in self.obj.get_ancestor_primary_keys():
 yield key
@@ -890,7 +909,9 @@ class LDAPSearch(CallbackInterface, crud.Search):
 
 try:
 (entries, truncated) = ldap.find_entries(
-filter, attrs_list, base_dn, scope=ldap.SCOPE_ONELEVEL
+filter, attrs_list, base_dn, scope=ldap.SCOPE_ONELEVEL,
+time_limit=options.get('timelimit', 1),
+size_limit=options.get('sizelimit', 3000)
 )
 except errors.ExecutionError, e:
 try:
-- 
1.7.1.1

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Re: [Freeipa-devel] [PATCH] Add new parameters to LDAPSearch: timelimit and sizelimit.

2010-08-09 Thread Rob Crittenden

Pavel Zůna wrote:

Doesn't include Robs loading of default values from cn=ipaConfig.

Pavel



ack for now.

We're going to need to remove the built-in defaults at some point and 
have it default to the value in cn=ipaconfig. I still need to rework the 
patch I made that does this.


rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Re: [Freeipa-devel] [PATCH] Add new parameters to LDAPSearch: timelimit and sizelimit.

2010-08-09 Thread Adam Young

On 08/09/2010 05:01 PM, Rob Crittenden wrote:

Pavel Zůna wrote:

Doesn't include Robs loading of default values from cn=ipaConfig.

Pavel



ack for now.

We're going to need to remove the built-in defaults at some point and 
have it default to the value in cn=ipaconfig. I still need to rework 
the patch I made that does this.


rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel



Lets get this in, and then get robs patch in, and then modify this code 
to use the defaults from Robs.  The caching issue can wait.If someone 
really cares about that, they can always service httpd restart to 
force flush the cache.


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel