From 55642c2144e1eb91e6d0ca282b734b387f2900a0 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Sun, 27 May 2018 12:26:37 +0100 Subject: [sosreport] do not display {add,del}_preset in --list-presets Signed-off-by: Bryn M. Reeves --- sos/sosreport.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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) -- cgit