Skip to content

Add preset for Canonical OpenStack with Sunbeam#4332

Merged
TurboTurtle merged 2 commits into
sosreport:mainfrom
arif-ali:sos-arif-sunbeam-preset
Jun 4, 2026
Merged

Add preset for Canonical OpenStack with Sunbeam#4332
TurboTurtle merged 2 commits into
sosreport:mainfrom
arif-ali:sos-arif-sunbeam-preset

Conversation

@arif-ali

Copy link
Copy Markdown
Member

Also loads presets for both Ubuntu and Debian, so that local presets can also be loaded.

Closes: #4331


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@example.com?
  • 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?

@packit-as-a-service

Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/sosreport-sos-4332
  • And now you can install the packages.

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

@arif-ali arif-ali force-pushed the sos-arif-sunbeam-preset branch from 56ea336 to 0b582b6 Compare May 19, 2026 14:24
@jcastill jcastill added Kind/Ubuntu Ubuntu related item Kind/Policy Changes to the `Policy()` class, or a subclass thereof. labels May 19, 2026
Comment on lines +24 to +27
'kubernetes.all = True',
'kubernetes.describe = True',
'kubernetes.kubelogs = True',
'kubernetes.podlogs = True',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the spaces around = allowed? When I mimic the same in Red Hat Satellite preset:

SAT_OPTS = SoSOptions(log_size=100, plugopts=['apache.log = on', 'networking.traceroute = True'])

I get error:

# sos report -l

sos report (version 4.11.0)

no such option "log " for plugin (apache)
#

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I tested it, obviously not :)

agreed, it's an issue, but maybe that's an issue in itself, and we should solve that. I tested the below patch, which works for me now. So this way it truly behaves like a variable, and we can have spaces.

diff --git a/sos/report/__init__.py b/sos/report/__init__.py
index 20f314c0..05073d1b 100644
--- a/sos/report/__init__.py
+++ b/sos/report/__init__.py
@@ -960,15 +960,17 @@ class SoSReport(SoSComponent):
             for plugname, plug in self.loaded_plugins:
                 if plugname in opts:
                     for opt in opts[plugname]:
+                        opt = opt.strip()
                         if opt not in plug.options:
                             self.soslog.error(f'no such option "{opt}" for '
                                               f'plugin ({plugname})')
                             self._exit(1)
                         try:
-                            plug.options[opt].set_value(opts[plugname][opt])
+                            plug.options[opt].set_value(
+                                opts[plugname][opt].strip())
                             self.soslog.debug(
                                 f"Set {plugname} plugin option to "
-                                f"{plug.options[opt]}")
+                                f"{plug.options[opt].strip()}")
                         except Exception as err:
                             self.soslog.error(err)
                             self._exit(1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wont work on cmdline args (obviusly), will work in presets and I guess also in config file - sounds good to me!

Let add a commit for that.

@arif-ali arif-ali force-pushed the sos-arif-sunbeam-preset branch from 0b582b6 to 215a882 Compare June 3, 2026 16:42

@pmoravec pmoravec left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe splitting the commit to preset and to plugopt enhancement would be beneficial, but I am ok as is.

(leaving on Arif to decide if it is worth splitting, will merge after 24 hours otherwise)

arif-ali added 2 commits June 4, 2026 09:04
Also loads presets for both Ubuntu and Debian, so that local presets
can also be loaded.

Closes: sosreport#4331
Signed-off-by: Arif Ali <arif-ali@ubuntu.com>
At the moment on variables with no spaces are allowed,
this ensures we can have spaces around the = sign.

Signed-off-by: Arif Ali <arif-ali@ubuntu.com>
@arif-ali arif-ali force-pushed the sos-arif-sunbeam-preset branch from 215a882 to 525bf3b Compare June 4, 2026 08:07
@TurboTurtle TurboTurtle added the Reviewed/Ready for Merge Has been reviewed, ready for merge label Jun 4, 2026
@TurboTurtle TurboTurtle merged commit e0c60a4 into sosreport:main Jun 4, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kind/Policy Changes to the `Policy()` class, or a subclass thereof. Kind/Ubuntu Ubuntu related item Reviewed/Ready for Merge Has been reviewed, ready for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues with preset on Debian and Ubuntu

4 participants