From a486f49a3726934f99763cc6ae93a41dafc40deb Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Wed, 26 Oct 2011 11:12:38 +0200 Subject: Create pkey-only option for find commands New option --pkey-only is available for all LDAPSearch based classes with primary key visible in the output. This option makes LDAPSearch commands search for primary attribute only. This may be useful when manipulating large data sets. User can at first retrieve all primary keys in a relatively small data package and then run further commands with retrieved primary keys. https://fedorahosted.org/freeipa/ticket/1262 --- ipalib/plugins/pwpolicy.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ipalib/plugins/pwpolicy.py') diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py index f261de562..6c5e6c56b 100644 --- a/ipalib/plugins/pwpolicy.py +++ b/ipalib/plugins/pwpolicy.py @@ -458,6 +458,8 @@ class pwpolicy_find(LDAPSearch): __doc__ = _('Search for group password policies.') def post_callback(self, ldap, entries, truncated, *args, **options): + if options.get('pkey_only', False): + return False for e in entries: # attribute rights are not allowed for pwpolicy_find self.obj.add_cospriority(e[1], e[1]['cn'][0], rights=False) -- cgit