-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix alternatives module #4836
Fix alternatives module #4836
Conversation
I think that idempotence of the module probably has some problems on RHEL (see #4810 (comment)), but this PR should at least make the module work again when subcommands are not used. |
@@ -77,6 +77,7 @@ | |||
description: | |||
- The path to the symbolic link that should point to the real subcommand executable. | |||
type: path | |||
required: true |
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.
When link
wasn't specified, the module generated an invalid argument for alternatives
and failed. So this change shouldn't break anything that was working.
I did some quick tests with RHEL 8.5 and python3, and it seems to work fine. |
Should not this have been caught by the |
The tests do not cover this since they never switch between alternatives when subcommands are present. |
f8e0e9e
to
109bdc0
Compare
The tests should now cover that. I also added some more debug output so that when they start failing in the future, its (hopefully) easier to figure out what goes wrong. |
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #4840 🤖 @patchback |
* Only pass subcommands when they are specified as module arguments. * When 'subcommands' is specified, 'link' must be given for every subcommand. * Extend subcommand tests. (cherry picked from commit 84d8ca9)
@pilou- thanks a lot for reviewing and testing this! |
SUMMARY
Fixes #4803, fixes #4804.
CC @jiuka
ISSUE TYPE
COMPONENT NAME
alternatives