[Freeipa-devel] [PATCH] 309 Fix addattr internal error

Martin Kosek mkosek at redhat.com
Fri Sep 14 06:40:32 UTC 2012


On 09/13/2012 09:19 PM, Rob Crittenden wrote:
> Martin Kosek wrote:
>> When ADD command is being executed and a single-value object attribute
>> is being set with both option and addattr IPA ends up in an internal
>> error.
>>
>> Make better value sanitizing job in this case and let IPA throw
>> a user-friendly error. Unit test exercising this situation is added.
>>
>> https://fedorahosted.org/freeipa/ticket/2429
> 
> +                if not isinstance(val, (list, tuple)):
> +                    val = [val]
> +            val.extend(adddict[attr])
> 
> I val is a tuple the extend is still going to fail. Can val ever be a tuple? If
> so we'd need to convert it to a list.
> 
> rob

I don't think it could be a tuple, I am about 99% certain. So for this 1% I
added a special clause for tuple. Patch attached.

We will be able to be even more certain when Honza finishes his strict encoding
patch he was working on in the summer. With his patch, the attributes should
always be a list.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-mkosek-309-2-fix-addattr-internal-error.patch
Type: text/x-patch
Size: 2411 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120914/17991f46/attachment.bin>


More information about the Freeipa-devel mailing list