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 _______________________________________________ Freeipa-devel mailing list Freeipa-devel@redhat.com https://www.redhat.com/mailman/listinfo/freeipa-devel