[Freeipa-devel] [PATCH 0024] ipa-replica-manage: added --suffix option for certain commands

Stanislav Laznicka slaznick at redhat.com
Thu Mar 24 18:10:27 UTC 2016


On 03/23/2016 08:13 PM, Martin Basti wrote:
> [...]
> Can you please update design
> http://www.freeipa.org/page/V4/Manage_replication_topology_4_4 (mainly
> the --suffix option)? Also there are missing clean-ruv and list-ruv
> commands in design, and fix usage at the bottom.
>
> 1)
> I don't understand this expression
> +            if dirman_passwd is None or (
> +               not dirman_passwd and args[0] in cs_enabled_commands):
>
> You already tested if subcommand belongs to cs_enabled_commands few
> lines above, IMO the 'dirman_password is None' expression is enough.
If I understand it well, when empty password is entered, the program 
continues and uses Kerberos credentials for some operations. E.g. for 
list-ruv, if empty password is entered, the command would only display 
RUVs for domain tree but not for the CA tree no matter if CA is set up 
or not (in the current state of the patch, after get_ruv refactoring). 
This here is one possible way around this, although the check for 
non-empty password might probably just as well be in get_ruv_both_suffixes.
> 2)
> +# tuple of commands that work with ca tree and need Directory Manager
> password
> +cs_enabled_commands = ("list-ruv", "clean-ruv", "abort-clean-ruv")
>
> this variable is used only toi detect if dirman passwd is needed, I
> suggest to rename it to commands_req_dirman_passwd, or something better.
>
> 3)
> Q: Do we need is_cs_set() function?
> A: Yes!
>
> I wanted to give you ultimate NACK, but then I checked how get_ruv code
> works and I changed my mind.
>
> Please write a comment where is_cs_set function is used, why we need
> extra function instead of catching an exception, possibly you can open a
> refactoring ticket.
After the refactoring changes, is_cs_set should not be needed anymore, 
removed it.
>
> Shame:
> 1)
> +        if not test_connection(realm, host, options.nolookup) or\
> Please use parentheses instead of backslash
>
> 2)
> +           args[0] in cs_enabled_commands:
>
> +               not dirman_passwd and args[0] in cs_enabled_commands):
>
> Indentation is not multiplication of 4
Shame on me indeed, fixed it.
>
> Nitpicks (I don't insist on fixing these):
> 1)
> +    if servers.get('ca', None):
>
> None is default
>
> 2)
> +        for (netloc, rid) in servers['ca']:
> parentheses are not needed
>
> 3)
> + print("\t%s: %s" % (netloc, rid))
> Would be nice to use .format() instead of %
>
> Martin^2
>
>
>
> I changed my mind, ultimate NACK.
> Please fix get_ruv function, is_cs_set will not help. In case there are no RUVs but CA is installed, sys.exit there prevents us from removing RUVs (or any else operation) on domain suffix, and vice versa.
> I propose to move ticket to 4.4 milestone because I would like to avoid breaking something in 4.3, as this will hit many places in ipa-replica-manage.
>
> Please provide the refactoring of get_ruv as separate patch a put these patches on top of it.
>
> Martin2
Did the refactoring. There also seemed to be duplicit code in 
abort_clean_ruv for some reason, removed it (I hope it does not break 
anything, but it seemed rather useless). Also had to change the numbers 
of the patches so that they would apply.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-stlaz-0026-ipa-replica-manage-refactoring.patch
Type: text/x-patch
Size: 5261 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160324/e4dd1d2d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-stlaz-0027-abort-clean-list-clean-ruv-now-work-for-both-suffixe.patch
Type: text/x-patch
Size: 10960 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160324/e4dd1d2d/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-stlaz-0028-Moved-password-check-from-clean_dangling_ruv.patch
Type: text/x-patch
Size: 2505 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20160324/e4dd1d2d/attachment-0002.bin>


More information about the Freeipa-devel mailing list