[Freeipa-devel] [PATCH] 454 Migration does not add users to default group

Petr Viktorin pviktori at redhat.com
Wed Feb 5 14:25:17 UTC 2014


On 01/31/2014 10:22 AM, Martin Kosek wrote:
> On 01/28/2014 02:18 PM, Petr Viktorin wrote:
>> On 01/27/2014 12:32 PM, Martin Kosek wrote:
>>> When users with missing default group were searched, IPA suffix was
>>> not passed so these users were searched in a wrong base DN. Thus,
>>> no user was detected and added to default group.
>>>
>>> https://fedorahosted.org/freeipa/ticket/4141
>>
>> This needs a rebase for the new LDAP API.
>
> I tested primarily on ipa-3-3 branch, I will rebase when acked.
>
>> I don't see the need for the second change, caching of len(new_members). On
>> lists, len() is extremely fast.
>> If you want to optimize, convert the list of existing members to a set before
>> the for loop, instead of getting it from the entry and using the `in` operator
>> (which is O(N) on lists) every time.
>
> Makes sense, done.
>
>>
>>
>> Nitpicks:
>>
>> Instead of "if len(container) > 0:" you should just use "if container:" (see
>> PEP8).
>
> Fixed.
>
>>
>> Instead of:
>>      members = group_entry_attrs.get('member', [])
>>      ...
>>      group_entry_attrs['member'] = members
>> you can use:
>>      members = group_entry_attrs.setdefault('member', [])
>>      ...
>
> Fixed.
>
> New patch attached (tested).
>
> Martin

Works fine, ACK. You can rebase to master now.

-- 
Petr³




More information about the Freeipa-devel mailing list