[Freeipa-devel] [PATCHES] 0499-0502 permission CLI: rename --permissions to --right

Petr Viktorin pviktori at redhat.com
Fri Mar 21 11:50:24 UTC 2014


On 03/21/2014 12:10 PM, Misnyovszki Adam wrote:
> On Fri, 21 Mar 2014 11:14:43 +0100
> Petr Viktorin <pviktori at redhat.com> wrote:
>
>> On 03/20/2014 07:20 PM, Misnyovszki Adam wrote:
>>> On Tue, 18 Mar 2014 12:02:06 +0100
>>> Petr Viktorin <pviktori at redhat.com> wrote:
>>>
>>>> Hello,
>>>> This renames --permissions to --right. The old name is kept as a
>>>> deprecated alias.
>>>> FreeIPA didn't have a mechanism for doing this, so I added one.
>>>> Also, while I was digging around in this part, I made the new
>>>> IntEnum (and all future Enums) act like StrEnum in --help output.
>>>>
>>>>
>>>> https://fedorahosted.org/freeipa/ticket/4231
>>>>
>>>
>>> 499 ACK
>>> 500 ACK
>>> 501 ACK
>>>    - although should it allow mixing deprecated and current
>>> aliases(eg --permission=read --right=write)?
>>
>> You're right, this is a strange edge case, but detecting this would
>> need need a much more complicated approach than sharing the option's
>> `dest`. I don't think it's worth it.
>>
>>>    - works fine with cli / webui also
>>>    - help displays nicely
>>> 502
>>>    - tested with more than one deprecated alias - API.txt validation
>>>      doesn't match, although it has the same output:
>>> Got StrEnum('ipapermright', attribute=True, cli_name='right',
>>> deprecated_cli_aliases=set(['testalias', 'permissions']),
>>> multivalue=True, required=False, values=(u'read', u'search',
>>> u'compare', u'write', u'add', u'delete', u'all'))
>>> Expected StrEnum('ipapermright', attribute=True, cli_name='right',
>>> deprecated_cli_aliases=set(['testalias','permissions']),
>>> multivalue=True, required=False, values=(u'read', u'search',
>>> u'compare', u'write', u'add', u'delete', u'all'))
>>>
>>> API.txt:
>>> option: StrEnum('ipapermright', attribute=True,
>>> cli_name='right',
>>> deprecated_cli_aliases=set(['testalias','permissions']),
>>> multivalue=True, required=False, values=(u'read', u'search',
>>> u'compare', u'write', u'add', u'delete', u'all'))
>>> ipalib/plugins/permission.py:
>>>           StrEnum(
>>>               'ipapermright*',
>>>               cli_name='right',
>>>               deprecated_cli_aliases={'permissions','testalias'},
>>>               label=_('Granted
>>> rights'),
>>>               doc=_('Rights to grant
>>> '
>>>                     '(read, search, compare, write, add, delete,
>>> all)'),
>>>               values=(u'read', u'search',
>>> u'compare',
>>>                       u'write', u'add', u'delete',
>>> u'all'),
>>>           ),
>>> don't know if it is a problem anyways
>>>    - other tests(cli, webui) works fine for me
>>>    - unit tests related to this ran as expected
>>> so besides the multiple deprecated_cli_aliases issue, it's an ACK
>>
>> It looks like you've edited API.txt by hand and forgot a space after
>> the comma in ['testalias','permissions']. Does it work if you use
>> makeapi to regenerate API.txt?
>>
>
> You are right, my mistake, with ./makeapi, it works, even when the CLI
> got this for parameters:
> --right=read --permission=search --testparam=write
>
> ACK

Thanks for the review!

> Greets
> Adam
>

Adam commented in person that I should bump VERSION; I did that as an 
additional one-liner change.

Pushed to master: 801b2fd4588b8b40b74140f26b12eb190306d260


-- 
Petr³
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pviktori-0502.2-permission-CLI-rename-permissions-to-right.patch
Type: text/x-patch
Size: 5649 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20140321/96b01da3/attachment.bin>


More information about the Freeipa-devel mailing list