diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2020-07-09 09:29:26 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2020-07-21 10:01:01 -0400 |
commit | 34de89edf5311630f4ceab07ff2b21694182646d (patch) | |
tree | 9449006fb5a8318ac92eb615d2d4d6a634b33d8d | |
parent | b350e34bc175a56eb8b941ae7e3c89b2d876ea48 (diff) | |
download | sos-34de89edf5311630f4ceab07ff2b21694182646d.tar.gz |
[report] Update preset config path and loading.
Updates the preset configuration path from `/var/lib/sos/presets` to
`/etc/sos/presets.d` and update the functions to load and write this
location.
Related: #2125
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/policies/__init__.py | 7 | ||||
-rw-r--r-- | sos/report/__init__.py | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index 6fd08adf..c6b329ed 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -22,7 +22,7 @@ from sos import _sos as _ from textwrap import fill from pipes import quote -PRESETS_PATH = "/var/lib/sos/presets" +PRESETS_PATH = "/etc/sos/presets.d" try: import requests @@ -931,9 +931,8 @@ any third party. pd.note = data[NOTE] if NOTE in data else "" if OPTS in data: - for arg in _arg_names: - if arg in data[OPTS]: - setattr(pd.opts, arg, data[OPTS][arg]) + for arg in data[OPTS]: + setattr(pd.opts, arg, data[OPTS][arg]) pd.builtin = False self.presets[preset] = pd diff --git a/sos/report/__init__.py b/sos/report/__init__.py index 74454806..31a6146f 100644 --- a/sos/report/__init__.py +++ b/sos/report/__init__.py @@ -751,8 +751,8 @@ class SoSReport(SoSComponent): return False # Filter --add-preset <name> from arguments list - arg_index = self._args.index("--add-preset") - args = self._args[0:arg_index] + self._args[arg_index + 2:] + arg_index = self.cmdline.index("--add-preset") + args = self.cmdline[0:arg_index] + self.cmdline[arg_index + 2:] self.ui_log.info("Added preset '%s' with options %s\n" % (name, " ".join(args))) |