Fixes #38147 - correctly find org on FakeActivationKey #11280
Merged
+3
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the changes introduced in this pull request?
In CVEAKMigrator we create FakeActivationKeys and then try to use the
.organization
method on them, which results in an errorhttps://community.theforeman.org/t/issue-when-upgrading-to-3-13-and-the-fix/42026
This should prevent that error.
Considerations taken when implementing this change?
I suppose it's possible the organization referenced by the AK could have disappeared, and this won't fix that.
What are the testing steps for this pull request?
not really sure. I guess you'd have to down-migrate to before AK MultiCV
Then make sure you have at least one AK with a CV ID and LCE ID that does NOT correspond to a real ContentViewEnvironment (e.g. that content view has not been promoted to that lifecycle environment)
Then try CVEAKMigrator.new.execute! in the console and make sure that codepath runs.
Alternatively, what I did to reproduce is, in the console