diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2018-05-30 10:38:30 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2018-06-20 18:01:21 +0100 |
commit | 3e2744da3f74e51d40b538081fc3636aa77ae8b9 (patch) | |
tree | 3e806fa1dfcdbe2fb6ce70839d984e88596f97ef | |
parent | f65e33ee8cbfa46cacb7f69dec5b80064aa5378b (diff) | |
download | sos-3e2744da3f74e51d40b538081fc3636aa77ae8b9.tar.gz |
[policies] mark new user preset as not builtin
The changes to prevent attempts to write builtin presets also
prevent user presets from being written:
# ./sosreport --batch --debug --profile system --add-preset qux2
sosreport (version 3.5)
Could not add preset: Cannot write built-in preset
This is because although we correctly clear pd.builtin on preset
load, we do not clear the flag when initialising a new user
preset from the command line.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/policies/__init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index 7b07d57c..14ed2a07 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -625,6 +625,7 @@ No changes will be made to system configuration. raise ValueError("A preset with name '%s' already exists" % name) preset = PresetDefaults(name=name, desc=desc, note=note, opts=opts) + preset.builtin = False self.presets[preset.name] = preset preset.write(presets_path) |