Add preset for Canonical OpenStack with Sunbeam#4332
Conversation
|
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. |
56ea336 to
0b582b6
Compare
| 'kubernetes.all = True', | ||
| 'kubernetes.describe = True', | ||
| 'kubernetes.kubelogs = True', | ||
| 'kubernetes.podlogs = True', |
There was a problem hiding this comment.
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)
#
There was a problem hiding this comment.
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)There was a problem hiding this comment.
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.
0b582b6 to
215a882
Compare
pmoravec
left a comment
There was a problem hiding this comment.
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)
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>
215a882 to
525bf3b
Compare
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