mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Make timelimit a parameter to the find methods.
This commit is contained in:
@@ -212,7 +212,7 @@ class Root(controllers.RootController):
|
||||
uid = kw.get('uid')
|
||||
if uid != None and len(uid) > 0:
|
||||
try:
|
||||
users = client.find_users(uid.encode('utf-8'))
|
||||
users = client.find_users(uid.encode('utf-8'), None, 0, 2)
|
||||
counter = users[0]
|
||||
users = users[1:]
|
||||
if counter == -1:
|
||||
@@ -596,7 +596,7 @@ class Root(controllers.RootController):
|
||||
criteria = kw.get('criteria')
|
||||
if criteria != None and len(criteria) > 0:
|
||||
try:
|
||||
groups = client.find_groups(criteria.encode('utf-8'))
|
||||
groups = client.find_groups(criteria.encode('utf-8'), None, 0, 2)
|
||||
counter = groups[0]
|
||||
groups = groups[1:]
|
||||
if counter == -1:
|
||||
|
||||
@@ -448,13 +448,11 @@ class IPAServer:
|
||||
|
||||
return users
|
||||
|
||||
def find_users (self, criteria, sattrs=None, searchlimit=0, opts=None):
|
||||
def find_users (self, criteria, sattrs=None, searchlimit=0, timelimit=-1,
|
||||
opts=None):
|
||||
"""Returns a list: counter followed by the results.
|
||||
If the results are truncated, counter will be set to -1."""
|
||||
|
||||
# TODO - retrieve from config
|
||||
timelimit = 2
|
||||
|
||||
# Assume the list of fields to search will come from a central
|
||||
# configuration repository. A good format for that would be
|
||||
# a comma-separated list of fields
|
||||
@@ -664,14 +662,12 @@ class IPAServer:
|
||||
finally:
|
||||
self.releaseConnection(conn)
|
||||
|
||||
def find_groups (self, criteria, sattrs=None, searchlimit=0, opts=None):
|
||||
def find_groups (self, criteria, sattrs=None, searchlimit=0, timelimit=-1,
|
||||
opts=None):
|
||||
"""Return a list containing a User object for each
|
||||
existing group that matches the criteria.
|
||||
"""
|
||||
|
||||
# TODO - retrieve from config
|
||||
timelimit = 2
|
||||
|
||||
# Assume the list of fields to search will come from a central
|
||||
# configuration repository. A good format for that would be
|
||||
# a comma-separated list of fields
|
||||
|
||||
Reference in New Issue
Block a user