aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/policies/__init__.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py
index e3c1b60d..07c3f922 100644
--- a/sos/policies/__init__.py
+++ b/sos/policies/__init__.py
@@ -395,6 +395,16 @@ class PresetDefaults(object):
os.unlink(os.path.join(presets_path, self.name))
+NO_PRESET = 'none'
+NO_PRESET_DESC = 'Do not load a preset'
+NO_PRESET_NOTE = 'Use to disable automatically loaded presets'
+
+GENERIC_PRESETS = {
+ NO_PRESET: PresetDefaults(name=NO_PRESET, desc=NO_PRESET_DESC,
+ note=NO_PRESET_NOTE, opts=SoSOptions())
+ }
+
+
class Policy(object):
msg = _("""\
@@ -438,6 +448,7 @@ No changes will be made to system configuration.
self._valid_subclasses = []
self.set_exec_path()
self._host_sysroot = sysroot
+ self.register_presets(GENERIC_PRESETS)
def get_valid_subclasses(self):
return [IndependentPlugin] + self._valid_subclasses
@@ -720,7 +731,7 @@ No changes will be made to system configuration.
:returns: a ``PresetDefaults`` object.
"""
- return self.presets[""]
+ return self.presets[NO_PRESET]
def load_presets(self, presets_path=None):
"""Load presets from disk.