diff options
Diffstat (limited to 'ipalib/plugins/user2.py')
-rw-r--r-- | ipalib/plugins/user2.py | 16 |
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) |