[Freeipa-devel] [PATCH] 0139 trustdomain_find: make sure we skip short entries when --pkey-only is specified
Martin Kosek
mkosek at redhat.com
Wed Feb 26 15:48:17 UTC 2014
On 02/25/2014 06:56 PM, Alexander Bokovoy wrote:
> Hi,
>
> Simple patch to fix KeyError as --pkey-only causes no attributes to be
> returned and trustdomain_find.post_callback checked them
> unconditionally.
>
>
> https://fedorahosted.org/freeipa/ticket/4196
Can we simply skip the whole loop when options.get('pkey_only', False)? I.e.:
def post_callback(self, ldap, entries, truncated, *args, **options):
if not options.get('pkey_only', False):
trust_dn = self.obj.get_dn(args[0], trust_type=u'ad')
trust_entry = ldap.get_entry(trust_dn)
...
It seems to me that your way we still do one unnecessary LDAP search which is
never used. With pkey_only we should not be filling anything in post_callback
at all if it is not affecting the pkey.
Martin
More information about the Freeipa-devel
mailing list