summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/user2.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2009-06-15 15:59:20 +0200
committerRob Crittenden <rcritten@redhat.com>2009-06-15 11:19:04 -0400
commit2ff4b3906ffbcd89330e40fa7f69f5c668996b72 (patch)
tree989cf3bf7e078c5a1d686e53a2c9d6ad3b4d2b73 /ipalib/plugins/user2.py
parent48e1f47ed130110db953aaf6a765faab438e1305 (diff)
downloadfreeipa.git-2ff4b3906ffbcd89330e40fa7f69f5c668996b72.tar.gz
freeipa.git-2ff4b3906ffbcd89330e40fa7f69f5c668996b72.tar.xz
freeipa.git-2ff4b3906ffbcd89330e40fa7f69f5c668996b72.zip
Change plugins2 using find_entries to support incomplete (truncated) search results.
Diffstat (limited to 'ipalib/plugins/user2.py')
-rw-r--r--ipalib/plugins/user2.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/ipalib/plugins/user2.py b/ipalib/plugins/user2.py
index 2d74a6d1..bf24e4d0 100644
--- a/ipalib/plugins/user2.py
+++ b/ipalib/plugins/user2.py
@@ -274,24 +274,30 @@ class user2_find(crud.Search):
# get matching entries
try:
- entries = ldap.find_entries(
+ (entries, truncated) = ldap.find_entries(
filter, attrs_list, _container_dn, ldap.SCOPE_ONELEVEL
)
except errors.NotFound:
- entries = tuple()
+ (entries, truncated) = (tuple(), False)
- return entries
+ return (entries, truncated)
def output_for_cli(self, textui, result, term, **options):
+ (entries, truncated) = result
+
textui.print_name(self.name)
- for e in result:
- (dn, entry_attrs) = e
+ for (dn, entry_attrs) in entries:
textui.print_attribute('dn', dn)
textui.print_entry(entry_attrs)
textui.print_plain('')
textui.print_count(
len(result), '%i user matched.', '%i users matched.'
)
+ if truncated:
+ textui.print_dashed('These results are truncated.', below=False)
+ textui.print_dashed(
+ 'Please refine your search and try again.', above=False
+ )
api.register(user2_find)