Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replica install: relax domain level check for promotion #416

Conversation

frasertweedale
Copy link
Contributor

@frasertweedale frasertweedale commented Jan 30, 2017

promote_check currently requires DL == 1. Relax the check to
require DL >= 1, so that things will work for future DL increases.

Part of: https://fedorahosted.org/freeipa/ticket/5011

@frasertweedale
Copy link
Contributor Author

Build failure is unrelated to patch.

@frasertweedale frasertweedale force-pushed the feature/5011-replica-promotion-relax-dl-check branch from a97b9db to aa19592 Compare January 31, 2017 01:42
@MartinBasti MartinBasti added the ack Pull Request approved, can be merged label Jan 31, 2017
@HonzaCholasta
Copy link
Contributor

Excuse me, but what is the point of checking for an exact domain level? Shouldn't check_domain_level() rather always check for a minimum domain level?

@MartinBasti
Copy link
Contributor

expected is for domain level 0, because there are different expectations about replica file, it must exactly match domain level 0, you cannot have higher DL.

@HonzaCholasta
Copy link
Contributor

I see. The point is, check_domain_level() is supposed to check whether replica promotion is possible or not in the current domain level, so it's weird it has an expected domain level argument and even weirder to introduce additional minimum domain level argument, when all it should have is a single boolean argument saying wheter you want to promote or not:

def check_domain_level(api, want_promote):
    ...

    promote = current >= constants.DOMAIN_LEVEL_1
    if promote != want_promote:
        raise RuntimeError(message)

    ...

@MartinBasti
Copy link
Contributor

IMO the whole check_domain_level is somehow broken, AFAIK the main purpose of it is to print correct error message related to replica file option, depending on current and expected domain level.

@stlaz may know more details

@MartinBasti MartinBasti removed the ack Pull Request approved, can be merged label Jan 31, 2017
@frasertweedale
Copy link
Contributor Author

So, what do we want the behaviour of check_domain_level to be? I just want to make a small change so that replica install does not break if DL > 1.

promote_check currently requires DL == 1.  Relax the check to
require DL >= 1, so that things will work for future DL increases.

Also separate the concerns of retrieving the current domain level,
validating whether the domain level is supported by the IPA version,
and validating whether the current domain level supports the replica
installation method attempted (i.e. replica file versus promotion).

Part of: https://fedorahosted.org/freeipa/ticket/5011
@frasertweedale frasertweedale force-pushed the feature/5011-replica-promotion-relax-dl-check branch from aa19592 to 5517b9e Compare February 1, 2017 01:02
@frasertweedale
Copy link
Contributor Author

@HonzaCholasta @MartinBasti PR updated. I extracted the specific (== 0) and (>= 1) checks to the relevant call sites. Also separated DL retrieval and "DL in range for IPA version" check into separate functions.

@stlaz
Copy link
Contributor

stlaz commented Feb 3, 2017

The purpose of check_domain_level() was to have a unified means of checking whether the domain level in the rest of the domain corresponds to the installation media which is presented by the user.

Looking back at it I think I chose poor naming and documentation of the check so it's rather confusing.
If you find a way to make a unified check in both domain levels (=> a single function call for both DLs that will raise exception when wrong installation media is presented), that'd be nice. Otherwise feel free to split it back to what it was previously.

@frasertweedale
Copy link
Contributor Author

@stlaz there are three considerations when "checking the DL":

  1. Retrieving the current DL.
  2. Checking that current DL is supported by server version.
  3. Checking that attempted method of installation is supported on currently DL.

Whether it makes sense to have a unified function for (3), I am not sure. I think the approach as implemented in this PR - that each replica installation method checks the DL and if necessary raises an appropriate error message - is satisfactory. Certainly it makes more sense to me to have these checks separate from the check for (2).

@stlaz
Copy link
Contributor

stlaz commented Feb 6, 2017

@frasertweedale Alright. I am definitely not against having it separated since we came to the realization that replica install checks can not be merged in a satisfactory way anyway.

@frasertweedale
Copy link
Contributor Author

Any other changes requested? What's preventing ack on this?

@MartinBasti MartinBasti self-assigned this Feb 9, 2017
@MartinBasti
Copy link
Contributor

ACK and I found a new bug: https://fedorahosted.org/freeipa/ticket/6654

@MartinBasti MartinBasti added the ack Pull Request approved, can be merged label Feb 9, 2017
@MartinBasti
Copy link
Contributor

@MartinBasti MartinBasti added the pushed Pull Request has already been pushed label Feb 9, 2017
@MartinBasti MartinBasti closed this Feb 9, 2017
@frasertweedale frasertweedale deleted the feature/5011-replica-promotion-relax-dl-check branch March 1, 2017 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
4 participants