Skip to content

Commit

Permalink
[report] Revert changed formatting of plugin+presets lists
Browse files Browse the repository at this point in the history
During conversion to f-strings in sosreport#3606, some changes in UI output
happen. That makes some output less readable and could break some
automated tests anticipating given preset or plugin output strings.

This commit reverts back tto the original output, using f-strings.

Resolves: sosreport#3762

Signed-off-by: Pavel Moravec <[email protected]>
  • Loading branch information
pmoravec authored and TurboTurtle committed Aug 26, 2024
1 parent 3d58e94 commit 3886534
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sos/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ def list_plugins(self):
self.ui_log.info(_("The following plugins are currently enabled:"))
self.ui_log.info("")
for (plugname, plug) in self.loaded_plugins:
self.ui_log.info(f"{plugname:<20} {plug.get_description()}")
self.ui_log.info(f" {plugname:<20} {plug.get_description()}")
else:
self.ui_log.info(_("No plugin enabled."))
self.ui_log.info("")
Expand All @@ -1039,7 +1039,7 @@ def list_plugins(self):
"disabled:"))
self.ui_log.info("")
for (plugname, plugclass, reason) in self.skipped_plugins:
self.ui_log.info(f"{plugname:<20} {reason:<14} "
self.ui_log.info(f" {plugname:<20} {reason:<14} "
f"{plugclass.get_description()}")

self.ui_log.info("")
Expand All @@ -1060,7 +1060,7 @@ def list_plugins(self):
val = TIMEOUT_DEFAULT
if opt.name == 'postproc':
val = not self.opts.no_postproc
self.ui_log.info(f"{opt.name:<25} {val:<15} {opt.desc}")
self.ui_log.info(f" {opt.name:<25} {val:<15} {opt.desc}")
self.ui_log.info("")

self.ui_log.info(_("The following plugin options are available:"))
Expand Down Expand Up @@ -1126,14 +1126,14 @@ def list_presets(self):
if not preset:
continue
preset = self.policy.find_preset(preset)
self.ui_log.info(f"name: {preset.name:>14}")
self.ui_log.info(f"description: {preset.desc:>14}")
self.ui_log.info(f"{'name:':>14} {preset.name}")
self.ui_log.info(f"{'description:':>14} {preset.desc}")
if preset.note:
self.ui_log.info(f"note: {preset.note:>14}")
self.ui_log.info(f"{'note:':>14} {preset.note}")

if self.opts.verbosity > 0:
args = preset.opts.to_args()
options_str = f"{'options:':>14}"
options_str = f"{'options:':>14} "
lines = _format_list(options_str, args, indent=True, sep=' ')
for line in lines:
self.ui_log.info(line)
Expand Down

0 comments on commit 3886534

Please sign in to comment.