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
[sosreport] /etc/sos.conf to support (more/some/all) command line options #855
Comments
Hm, I can add a new section (say So now I would end up with config options preceding cmdline options - something not intended. |
Since the time of opening this issue, presets were introduced. I expect the right ordering of evaluation of tunables/settings should be:
|
OK, now the ordering is different: first cmdline options are loaded, then overwritten by those in |
There is a bit chicken-egg problem:
(similar chicken-egg problem is with evaluating non-default config file prior command line options where we need to process cmdline before the config - this can be yet resolved by some trick) Gladly,
|
- SoSOptions class changes: - from_file method to load load options from file - encapsulation of particular options into __init__ method - updated merge logic to replace non-default values only - sosreport.py changes: - _parse_args (renamed to _get_parser) newly returns just the ArgumentParser object as parsing itself is done elsewhere - SoSOptions are built in ordering: - defaults from parser (with emtpy cmdline) loaded - cmdline options replace defaults - config file known even now - config.file options replace defaults until already set by cmdline (i.e. until SoSOptions marked them as nondefault) - presets can be known even now - options from given preset replace defaults, until the options are already updated from cmdline or config.file - some extra logging/formatting added - some extra comments added Resolves: sosreport#855 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Sosreport might be deployed in environments where different command line options might need to be used by default all the time. I.e. limit log size, set some plugin options, skip some plugins etc. It makes sense to store such defaults in
/etc/sos.conf
.Shall
sos.conf
support all or specific types of parameters?Shall cmdline options take precedence of the options in
sos.conf
(I think so)?The text was updated successfully, but these errors were encountered: