-
Notifications
You must be signed in to change notification settings - Fork 545
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
[component] Apply plugopts from cmdline gently #3855
base: main
Are you sure you want to change the base?
[component] Apply plugopts from cmdline gently #3855
Conversation
When plugopts are set both in a loaded preset and in cmdline, we should merge the options instead of blindly using cmdline ones. This means preset plugopt options not present in cmdline are added, while preset plugopt options also present in cmdline are ignored. Closes: sosreport#3855 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Reproducer:
(see the A simple solution "let merge the option lists" has a counterexample:
where we cant guarantee what value of |
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
Early comment to say, let's definitely get a test case written for this. |
I realized we have no test for presets. So I will add some generic plus some covering this PR. Before I dig into it - can I extend the current https://github.com/sosreport/sos/blob/main/tests/report_tests/options_tests/options_tests.py#L13 ? By changing it like:
This test will ensure the right priority of options among preset, config file and cmdline - see comments. Can I "squeeze" the preset tests into this (renamed) class? Additionally, I will have a class (or two) for testing the Does it sound a good plan? |
I do plan to add presets from Canonical at some point, so if we can generalise it, that would help when I get round to it. Or, otherwise I can extend the work here once I get to it |
Sounds good. So I will test the plugopts stuff via Red Hat preset for now. Extending the current |
When plugopts are set both in a loaded preset and in cmdline, we should merge the options instead of blindly using cmdline ones.
This means preset plugopt options not present in cmdline are added, while preset plugopt options also present in cmdline are ignored.
Closes: #3855
Relevant: RHEL-67097
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines