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

Nathaniel McCallum npmccallum at redhat.com
Mon Oct 7 21:30:57 UTC 2013


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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-npmccallum-0023-2-Add-optional_create-flag.patch
Type: text/x-patch
Size: 2665 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20131007/dfb216aa/attachment.bin>


More information about the Freeipa-devel mailing list