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
[1.24] 2182768: Disallowed attaching pool in SCA mode #3271
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a local get_current_owner() helper function that mimicks the one available in newer versions. Backporting the implementation available in newer version is complicated, and relies on not available bits such as the owner cache. This simple method will do, and reduces the differences in a couple of places with what's in more recent branches.
* BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1928072 * When SCA mode is used for selected organization, then do not try to do auto-attach at all and print info message * We use the same message as is already used for command attach --auto * Implemented this functionality, because old message was generated by candlepin server. Look at following candlepin PR: candlepin/candlepin#2947 (cherry picked from commit a36e10f) (cherry picked from commit a5dc6f6)
acab65c
to
a37ef31
Compare
* Card ID: ENT-4594 * Manual attaching of pool using --pool CLI option is not allowed now. When user tries to attach any pool in SCA mode, then info message is printedn and subscription-manager is terminated * Added two unit tests for auto-attach ins SCA mode and manual attach * Added more debug prints for cache used by function is_simple_content_access(), because I considered using this method, when --help is used, but calling subscription-manager attach --help would cause calling one REST API endpoint * Updated manual page about subscription-manager (cherry picked from commit 61cb998) (cherry picked from commit 4d258b1)
* BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2049101 * Card ID: ENT-4718 * Backport of original PR #2961 to 1.28. * Reverting of following commit: a0b5d65 * We were too aggressive, when we decided to disable this auto-attaching and attaching of pool for D-Bus API, when SCA mode is used. * This reverting should also give enough time for solving other BZs: https://bugzilla.redhat.com/show_bug.cgi?id=2049101 (Anaconda) https://bugzilla.redhat.com/show_bug.cgi?id=2049620 (Gnome) (cherry picked from commit 9a3f219)
* BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2097672 * Backport to 1.28 branch * Origin PR for main: #3116 * Not possible to do simple cherry-pick * Card ID: ENT-5115 * Changed warning message according suggestion in BZ bug report. * Refactored code a little (fixed typo in method name) (cherry picked from commit 7ee691a)
a37ef31
to
ba445f6
Compare
|
There are two tests that fail... because they are broken! I created #3272 to fix them. |
* BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2097672 * Manual backport of original PR: #3138 * Original commit: 2e62d0f * Card ID: ENT-5411 (cherry picked from commit f32cd11)
- BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2097672 - Card ID: ENT-5443 - Updated the expected message from a user's manual attach request (--pool) when SCA is enabled for the organization. (cherry picked from commit b52b2ea)
There are a couple of test cases for the "attach" command that check the behaviour for "--auto" and "--pool POOL_ID" in case of SCA; the problem is that they were broken until now for a couple of reasons: - the main() method of a command class (derived from AbstractCLICommand) takes a list of strings, and not a single string; since ArgumentParser.parse_known_args() iterates on its "args" argument, and iterating over a str is possible in Python 3, this "runs fine", however it matches nothing, exiting with an usage message - as consequence/related to the above, the two tests assumed the runs would fail, whereas because of the behaviour change they now cause a clean exit (with exit code 0) Hence, repair these two tests so they work: - pass the arguments to main() properly as list of strings, so ArgumentParser can parse them - drop the exception expectation, since they cause a clean exit Followup of commit 61cb998. (cherry picked from commit 792d685) (cherry picked from commit d6f2b79)
c6bfcd2
to
b7cae06
Compare
jirihnidek
approved these changes
May 30, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
allowed now. When user tries to attach any pool in SCA
mode, then info message is printedn and subscription-manager
is terminated
manual attach
is_simple_content_access(), because I considered using
this method, when --help is used, but calling
subscription-manager attach --help would cause calling
one REST API endpoint
Backport to 1.24 of the following PRs (backported from 1.28 to ease the backport changed needed):