Skip to content
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

[Options] Add test of skip_plugins before referring it #3904

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pmoravec
Copy link
Contributor

When a component honours plugopts but not skip_plugins Option, dont update plugopts per skip_plugins.

This is rather theoretical scenario, though.

Resolves: #3904


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname [email protected]?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

When a component honours plugopts but not skip_plugins Option, dont
update plugopts per skip_plugins.

This is rather theoretical scenario, though.

Resolves: sosreport#3904

Signed-off-by: Pavel Moravec <[email protected]>
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3904
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@pmoravec
Copy link
Contributor Author

Bit artificial reproducer: On one version of sos upload PR, there was + 'plugopts': [], added to arg_defaults, but no skip_plugins there. That was ridiculous for upload component, but let assume there is such a component.

Then having non-empty [plugin_options] in sos.conf, I was getting weird exception:

# python3 bin/sos upload fooo
Could not initialize 'upload': 'SoSOptions' object has no attribute 'skip_plugins'
Traceback (most recent call last):
  File "/root/sos-main/bin/sos", line 21, in <module>
    sos = SoS(sys.argv[1:])
  File "/root/sos-main/sos/__init__.py", line 118, in __init__
    self._init_component()
  File "/root/sos-main/sos/__init__.py", line 183, in _init_component
    raise err
  File "/root/sos-main/sos/__init__.py", line 178, in _init_component
    self._component = _to_load(self.parser, self.args, self.cmdline)
  File "/root/sos-main/sos/upload/__init__.py", line 58, in __init__
    super().__init__(parser, args, cmdline)
  File "/root/sos-main/sos/component.py", line 103, in __init__
    self.opts = self.load_options()  # lgtm [py/init-calls-subclass]
  File "/root/sos-main/sos/component.py", line 262, in load_options
    opts.update_from_conf(self.args.config_file, self.args.component)
  File "/root/sos-main/sos/options.py", line 232, in update_from_conf
    if not key.split('.')[0] in self.skip_plugins:
AttributeError: 'SoSOptions' object has no attribute 'skip_plugins'
#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant