Skip to content

Commit

Permalink
[report] Clean tmpdir when adding or deleting preset
Browse files Browse the repository at this point in the history
When adding or deleting preset (and also when detecting no plugin leaves
enabled), sos.report.execute must cleanup its working dir.

Since we don't use return value of the execute method, we can skip the
return command.

Resolves: #3430
Closes: #3431

Signed-off-by: Pavel Moravec <[email protected]>
  • Loading branch information
pmoravec authored and TurboTurtle committed Dec 2, 2023
1 parent 041da64 commit d53bffe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sos/report/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1809,12 +1809,14 @@ def execute(self):
self.list_presets()
raise SystemExit
if self.opts.add_preset:
return self.add_preset(self.opts.add_preset)
self.add_preset(self.opts.add_preset)
raise SystemExit
if self.opts.del_preset:
return self.del_preset(self.opts.del_preset)
self.del_preset(self.opts.del_preset)
raise SystemExit
# verify that at least one plug-in is enabled
if not self.verify_plugins():
return False
raise SystemExit

self.batch()
self.prework()
Expand Down

0 comments on commit d53bffe

Please sign in to comment.