[Freeipa-devel] [PATCH 0023] Add optional_create flag

Petr Viktorin pviktori at redhat.com
Tue Oct 8 14:49:17 UTC 2013


On 10/07/2013 11:30 PM, Nathaniel McCallum wrote:
> On Mon, 2013-10-07 at 14:26 +0200, Petr Viktorin wrote:
>> On 10/04/2013 10:01 PM, Nathaniel McCallum wrote:
>>> On Fri, 2013-10-04 at 13:37 -0400, Nathaniel McCallum wrote:
>>>> This patch is preparatory for the OTP CLI patch.
>>>
>>> I'm not quite sure why, but this patch apparently changes the output
>>> of ./makeapi. This change is now included in the attached patch. Is this
>>> a mistake of some sort? Or is this just correct?
>>>
>>> Nathaniel
>>
>> Apparently, Param.clone() uses all options, even those that are left out
>> of what API.txt reports (see __kw and __clonekw in Param.__init__). IMO
>> it's not ideal behavior, makeapi should have used __clonekw directly.
>>
>>
>> Anyway, to keep API.txt as before, only clone if necessary:
>>
>>        def __clone(self, param, **kw):
>>            if 'optional_create' in param.flags:
>>                kw['required'] = False
>> -        return param.clone(**kw)
>> +        if kw:
>> +            return param.clone(**kw)
>> +        else:
>> +            return param
>
> Fixed.
>
> This patch does still cause an error in the tests because param is a
> string. Is this a bug in the test?

Yes; I've fixed the test with the attached one-liner.

ACK, pushed to master: e05dfbd8b4b4e040266ecfba579bcd64e22b342b

-- 
Petr³
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0310-test_ipalib.test_crud-Don-t-use-a-string-in-takes_op.patch
Type: text/x-patch
Size: 1124 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131008/cf49f9ee/attachment.bin>


More information about the Freeipa-devel mailing list