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

Petr Viktorin pviktori at redhat.com
Fri Mar 21 10:14:43 UTC 2014


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?

-- 
Petr³




More information about the Freeipa-devel mailing list