aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2018-05-27 12:26:37 +0100
committerBryn M. Reeves <bmr@redhat.com>2018-06-20 18:01:21 +0100
commit55642c2144e1eb91e6d0ca282b734b387f2900a0 (patch)
treeb39ed7b8715a104c4dd1d31d82e758ce9c05cd38
parent8d63b1ff8f67eaef1b4eb3c7ead48b8cbd0c8369 (diff)
downloadsos-55642c2144e1eb91e6d0ca282b734b387f2900a0.tar.gz
[sosreport] do not display {add,del}_preset in --list-presets
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/sosreport.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py
index 96461c63..e708961d 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -865,7 +865,15 @@ class SoSReport(object):
if preset.note:
self.ui_log.info("%-15s (%s)" % ("", preset.note))
if self.opts.verbosity > 0:
+ # Filter out options that do not make sense in presets
+ def filter_opt(opt):
+ if opt.startswith("add_preset"):
+ return False
+ if opt.startswith("del_preset"):
+ return False
+ return True
opts = str(preset.opts).split()
+ opts = [opt for opt in opts if filter_opt(opt)]
lines = _format_list("%-15s" % "options: ", opts, indent=True)
for line in lines:
self.ui_log.info(line)