From 25b289a70490e74d778ef86604107b805360a545 Mon Sep 17 00:00:00 2001 From: Athrey Vinay Date: Wed, 15 Apr 2026 14:09:48 +0100 Subject: [PATCH 1/8] implementation... --- tests/clean/runs/test.sh | 3 +++ tmt/base/core.py | 31 ++++++++++++++++++++++++++----- tmt/steps/provision/testcloud.py | 13 +++++++++++-- tmt/utils/__init__.py | 9 +++++++++ 4 files changed, 49 insertions(+), 7 deletions(-) diff --git a/tests/clean/runs/test.sh b/tests/clean/runs/test.sh index b7f4936428..dfe4850cd2 100755 --- a/tests/clean/runs/test.sh +++ b/tests/clean/runs/test.sh @@ -21,6 +21,7 @@ rlJournalStart rlRun -s "tmt clean runs --dry -v --workdir-root $tmprun" rlAssertGrep "Would remove workdir '$run1'" "$rlRun_LOG" rlAssertGrep "Would remove workdir '$run2'" "$rlRun_LOG" + rlAssertGrep "Summary: Would free.*of disk space" "$rlRun_LOG" rlRun -s "tmt status --workdir-root $tmprun -vv" rlAssertGrep "(done\s+){1}(todo\s+){6}$run1\s+/plan1" "$rlRun_LOG" -E rlAssertGrep "(done\s+){1}(todo\s+){6}$run2\s+/plan1" "$rlRun_LOG" -E @@ -29,12 +30,14 @@ rlJournalStart rlPhaseStartTest "Specify ID" rlRun -s "tmt clean runs -v -i $run1" rlAssertGrep "Removing workdir '$run1'" "$rlRun_LOG" + rlAssertGrep "Summary: Freed.*of disk space" "$rlRun_LOG" rlRun -s "tmt status --workdir-root $tmprun -vv" rlAssertNotGrep "(done\s+){1}(todo\s+){6}$run1\s+/plan1" "$rlRun_LOG" -E rlAssertGrep "(done\s+){1}(todo\s+){6}$run2\s+/plan1" "$rlRun_LOG" -E rlRun -s "tmt clean runs -v -l --workdir-root $tmprun" rlAssertGrep "Removing workdir '$run2'" "$rlRun_LOG" + rlAssertGrep "Summary: Freed.*of disk space" "$rlRun_LOG" rlRun -s "tmt status --workdir-root $tmprun -vv" rlAssertNotGrep "(done\s+){1}(todo\s+){6}$run2\s+/plan1" "$rlRun_LOG" -E diff --git a/tmt/base/core.py b/tmt/base/core.py index 3015530c9e..7fdfa65574 100644 --- a/tmt/base/core.py +++ b/tmt/base/core.py @@ -3007,6 +3007,11 @@ def show(self) -> None: CleanCallback = Callable[[], bool] +def _dir_size(path: Path) -> int: + """Return the total size in bytes of all files under path.""" + return sum(f.stat().st_size for f in path.rglob('*') if f.is_file()) + + class Clean(tmt.utils.Common): """ A class for cleaning up workdirs, guests or images @@ -3154,14 +3159,15 @@ def guests(self, run_ids: tuple[str, ...], keep: Optional[int]) -> bool: successful = False return successful - def _clean_workdir(self, path: Path) -> bool: + def _clean_workdir(self, path: Path, size: int) -> bool: """ Remove a workdir (unless in dry mode) """ + formatted_size = tmt.utils.format_size(size) if self.is_dry_run: - self.verbose(f"Would remove workdir '{path}'.", shift=1) + self.verbose(f"Would remove workdir '{path}' ({formatted_size}).", shift=1) else: - self.verbose(f"Removing workdir '{path}'.", shift=1) + self.verbose(f"Removing workdir '{path}' ({formatted_size}).", shift=1) try: shutil.rmtree(path) except OSError as error: @@ -3184,7 +3190,14 @@ def runs(self, id_: tuple[str, ...], keep: Optional[int]) -> bool: # the correct one. last_run = Run(logger=self._logger, cli_invocation=self.cli_invocation) last_run.load_workdir(with_logfiles=False) - return self._clean_workdir(last_run.run_workdir) + size = _dir_size(last_run.run_workdir) + success = self._clean_workdir(last_run.run_workdir, size) + self.verbose( + f"Summary: {'Would free' if self.is_dry_run else 'Freed'} " + f"{tmt.utils.format_size(size)} of disk space.", + shift=1, + ) + return success all_workdirs = list(tmt.utils.generate_runs(self.workdir_root, id_, all_=True)) if keep is not None: # Sort by change time of the workdirs and keep the newest workdirs @@ -3192,10 +3205,18 @@ def runs(self, id_: tuple[str, ...], keep: Optional[int]) -> bool: all_workdirs = all_workdirs[keep:] successful = True + total_size = 0 for workdir in all_workdirs: - if not self._clean_workdir(workdir): + size = _dir_size(workdir) + total_size += size + if not self._clean_workdir(workdir, size): successful = False + self.verbose( + f"Summary: {'Would free' if self.is_dry_run else 'Freed'} " + f"{tmt.utils.format_size(total_size)} of disk space.", + shift=1, + ) return successful diff --git a/tmt/steps/provision/testcloud.py b/tmt/steps/provision/testcloud.py index f9b1dd42fd..daef55f093 100644 --- a/tmt/steps/provision/testcloud.py +++ b/tmt/steps/provision/testcloud.py @@ -1590,16 +1590,25 @@ def clean_images(cls, clean: 'tmt.base.core.Clean', dry: bool, workdir_root: Pat clean.warn(f"Directory '{testcloud_images}' does not exist.", shift=2) return True successful = True + total_size = 0 for image in testcloud_images.iterdir(): + size = image.stat().st_size + total_size += size + formatted_size = tmt.utils.format_size(size) if dry: - clean.verbose(f"Would remove '{image}'.", shift=2) + clean.verbose(f"Would remove '{image}' ({formatted_size}).", shift=2) else: - clean.verbose(f"Removing '{image}'.", shift=2) + clean.verbose(f"Removing '{image}' ({formatted_size}).", shift=2) try: image.unlink() except OSError: clean.fail(f"Failed to remove '{image}'.", shift=2) successful = False + clean.verbose( + f"Summary: {'Would free' if dry else 'Freed'} " + f"{tmt.utils.format_size(total_size)} of disk space.", + shift=2, + ) return successful diff --git a/tmt/utils/__init__.py b/tmt/utils/__init__.py index 5e9ec8acf4..5661d91a65 100644 --- a/tmt/utils/__init__.py +++ b/tmt/utils/__init__.py @@ -87,6 +87,15 @@ from tmt.hardware.constraints import Size +def format_size(size: int) -> str: + """Format a byte count into a human-readable string.""" + for unit in ('B', 'KB', 'MB', 'GB', 'TB'): + if size < 1024: + return f'{size:.1f} {unit}' + size = int(size / 1024) + return f'{size:.1f} PB' + + def sanitize_string(text: str) -> str: """Remove invalid Unicode characters from a string""" try: From 9f885a0d2710fb9ca08952c67f5ecd7bd6003d65 Mon Sep 17 00:00:00 2001 From: Athrey Vinay Date: Wed, 15 Apr 2026 14:19:53 +0100 Subject: [PATCH 2/8] docs: added a release note... --- docs/releases/pending/4593.fmf | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/releases/pending/4593.fmf diff --git a/docs/releases/pending/4593.fmf b/docs/releases/pending/4593.fmf new file mode 100644 index 0000000000..08369fa94e --- /dev/null +++ b/docs/releases/pending/4593.fmf @@ -0,0 +1,3 @@ +description: | + The ``tmt clean`` command now shows the size of each workdir + and a summary of total disk space freed. From 5d59283926969b3632ad28d915ec4176c857780e Mon Sep 17 00:00:00 2001 From: Athrey Vinay Date: Wed, 15 Apr 2026 21:53:36 +0100 Subject: [PATCH 3/8] address comments... --- tmt/base/core.py | 25 +++++++++++++------------ tmt/steps/provision/testcloud.py | 4 ++-- tmt/utils/__init__.py | 9 --------- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/tmt/base/core.py b/tmt/base/core.py index 7fdfa65574..67d7a0bd50 100644 --- a/tmt/base/core.py +++ b/tmt/base/core.py @@ -40,6 +40,7 @@ import tmt.export import tmt.frameworks import tmt.guest +import tmt.hardware import tmt.identifier import tmt.lint import tmt.log @@ -3009,7 +3010,7 @@ def show(self) -> None: def _dir_size(path: Path) -> int: """Return the total size in bytes of all files under path.""" - return sum(f.stat().st_size for f in path.rglob('*') if f.is_file()) + return sum(f.lstat().st_size for f in path.rglob('*')) class Clean(tmt.utils.Common): @@ -3159,11 +3160,12 @@ def guests(self, run_ids: tuple[str, ...], keep: Optional[int]) -> bool: successful = False return successful - def _clean_workdir(self, path: Path, size: int) -> bool: + def _clean_workdir(self, path: Path) -> tuple[bool, int]: """ Remove a workdir (unless in dry mode) """ - formatted_size = tmt.utils.format_size(size) + size = _dir_size(path) + formatted_size = round(tmt.hardware.UNITS(f'{size} bytes').to_compact(), 1) if self.is_dry_run: self.verbose(f"Would remove workdir '{path}' ({formatted_size}).", shift=1) else: @@ -3172,8 +3174,8 @@ def _clean_workdir(self, path: Path, size: int) -> bool: shutil.rmtree(path) except OSError as error: self.warn(f"Failed to remove '{path}': {error}.", shift=1) - return False - return True + return False, 0 + return True, size def runs(self, id_: tuple[str, ...], keep: Optional[int]) -> bool: """ @@ -3190,11 +3192,10 @@ def runs(self, id_: tuple[str, ...], keep: Optional[int]) -> bool: # the correct one. last_run = Run(logger=self._logger, cli_invocation=self.cli_invocation) last_run.load_workdir(with_logfiles=False) - size = _dir_size(last_run.run_workdir) - success = self._clean_workdir(last_run.run_workdir, size) + success, size = self._clean_workdir(last_run.run_workdir) self.verbose( f"Summary: {'Would free' if self.is_dry_run else 'Freed'} " - f"{tmt.utils.format_size(size)} of disk space.", + f"{round(tmt.hardware.UNITS(f'{size} bytes').to_compact(), 1)} of disk space.", shift=1, ) return success @@ -3207,14 +3208,14 @@ def runs(self, id_: tuple[str, ...], keep: Optional[int]) -> bool: successful = True total_size = 0 for workdir in all_workdirs: - size = _dir_size(workdir) - total_size += size - if not self._clean_workdir(workdir, size): + success, size = self._clean_workdir(workdir) + if not success: successful = False + total_size += size self.verbose( f"Summary: {'Would free' if self.is_dry_run else 'Freed'} " - f"{tmt.utils.format_size(total_size)} of disk space.", + f"{round(tmt.hardware.UNITS(f'{total_size} bytes').to_compact(), 1)} of disk space.", shift=1, ) return successful diff --git a/tmt/steps/provision/testcloud.py b/tmt/steps/provision/testcloud.py index daef55f093..efb6c1d46f 100644 --- a/tmt/steps/provision/testcloud.py +++ b/tmt/steps/provision/testcloud.py @@ -1594,7 +1594,7 @@ def clean_images(cls, clean: 'tmt.base.core.Clean', dry: bool, workdir_root: Pat for image in testcloud_images.iterdir(): size = image.stat().st_size total_size += size - formatted_size = tmt.utils.format_size(size) + formatted_size = round(tmt.hardware.UNITS(f'{size} bytes').to_compact(), 1) if dry: clean.verbose(f"Would remove '{image}' ({formatted_size}).", shift=2) else: @@ -1606,7 +1606,7 @@ def clean_images(cls, clean: 'tmt.base.core.Clean', dry: bool, workdir_root: Pat successful = False clean.verbose( f"Summary: {'Would free' if dry else 'Freed'} " - f"{tmt.utils.format_size(total_size)} of disk space.", + f"{round(tmt.hardware.UNITS(f'{total_size} bytes').to_compact(), 1)} of disk space.", shift=2, ) return successful diff --git a/tmt/utils/__init__.py b/tmt/utils/__init__.py index 5661d91a65..5e9ec8acf4 100644 --- a/tmt/utils/__init__.py +++ b/tmt/utils/__init__.py @@ -87,15 +87,6 @@ from tmt.hardware.constraints import Size -def format_size(size: int) -> str: - """Format a byte count into a human-readable string.""" - for unit in ('B', 'KB', 'MB', 'GB', 'TB'): - if size < 1024: - return f'{size:.1f} {unit}' - size = int(size / 1024) - return f'{size:.1f} PB' - - def sanitize_string(text: str) -> str: """Remove invalid Unicode characters from a string""" try: From a67d0811fef071524e31e2f7e99ba7b16ef85337 Mon Sep 17 00:00:00 2001 From: Athrey Vinay Date: Mon, 11 May 2026 16:44:37 +0100 Subject: [PATCH 4/8] address comments... --- tmt/base/core.py | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/tmt/base/core.py b/tmt/base/core.py index 67d7a0bd50..1a7b8b1391 100644 --- a/tmt/base/core.py +++ b/tmt/base/core.py @@ -3192,26 +3192,21 @@ def runs(self, id_: tuple[str, ...], keep: Optional[int]) -> bool: # the correct one. last_run = Run(logger=self._logger, cli_invocation=self.cli_invocation) last_run.load_workdir(with_logfiles=False) - success, size = self._clean_workdir(last_run.run_workdir) - self.verbose( - f"Summary: {'Would free' if self.is_dry_run else 'Freed'} " - f"{round(tmt.hardware.UNITS(f'{size} bytes').to_compact(), 1)} of disk space.", - shift=1, - ) - return success - all_workdirs = list(tmt.utils.generate_runs(self.workdir_root, id_, all_=True)) - if keep is not None: - # Sort by change time of the workdirs and keep the newest workdirs - all_workdirs.sort(key=lambda workdir: workdir.stat().st_ctime, reverse=True) - all_workdirs = all_workdirs[keep:] - - successful = True - total_size = 0 - for workdir in all_workdirs: - success, size = self._clean_workdir(workdir) - if not success: - successful = False - total_size += size + successful, total_size = self._clean_workdir(last_run.run_workdir) + else: + all_workdirs = list(tmt.utils.generate_runs(self.workdir_root, id_, all_=True)) + if keep is not None: + # Sort by change time of the workdirs and keep the newest workdirs + all_workdirs.sort(key=lambda workdir: workdir.stat().st_ctime, reverse=True) + all_workdirs = all_workdirs[keep:] + + successful = True + total_size = 0 + for workdir in all_workdirs: + success, size = self._clean_workdir(workdir) + if not success: + successful = False + total_size += size self.verbose( f"Summary: {'Would free' if self.is_dry_run else 'Freed'} " From bf964f3388fc0f3191e6f57e7af0b14382d6a198 Mon Sep 17 00:00:00 2001 From: Athrey Vinay Date: Tue, 12 May 2026 13:00:10 +0100 Subject: [PATCH 5/8] create a helper --- tmt/base/core.py | 5 +++-- tmt/hardware/__init__.py | 11 +++++++++++ tmt/steps/provision/testcloud.py | 5 +++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tmt/base/core.py b/tmt/base/core.py index 1a7b8b1391..9d07e6daed 100644 --- a/tmt/base/core.py +++ b/tmt/base/core.py @@ -3165,7 +3165,7 @@ def _clean_workdir(self, path: Path) -> tuple[bool, int]: Remove a workdir (unless in dry mode) """ size = _dir_size(path) - formatted_size = round(tmt.hardware.UNITS(f'{size} bytes').to_compact(), 1) + formatted_size = tmt.hardware.format_compact(tmt.hardware.UNITS(f'{size} bytes')) if self.is_dry_run: self.verbose(f"Would remove workdir '{path}' ({formatted_size}).", shift=1) else: @@ -3210,7 +3210,8 @@ def runs(self, id_: tuple[str, ...], keep: Optional[int]) -> bool: self.verbose( f"Summary: {'Would free' if self.is_dry_run else 'Freed'} " - f"{round(tmt.hardware.UNITS(f'{total_size} bytes').to_compact(), 1)} of disk space.", + f"{tmt.hardware.format_compact(tmt.hardware.UNITS(f'{total_size} bytes'))} " + f"of disk space.", shift=1, ) return successful diff --git a/tmt/hardware/__init__.py b/tmt/hardware/__init__.py index dec7380eec..73b444ff0f 100644 --- a/tmt/hardware/__init__.py +++ b/tmt/hardware/__init__.py @@ -26,6 +26,8 @@ [1] https://tmt.readthedocs.io/en/stable/spec/hardware.html """ +from typing import TYPE_CHECKING + from tmt.hardware.constraints import ( UNITS, Constraint, @@ -38,6 +40,14 @@ ) from tmt.hardware.requirements import Hardware +if TYPE_CHECKING: + from pint import Quantity + + +def format_compact(quantity: 'Quantity', digits: int = 1) -> str: + return str(round(quantity.to_compact(), digits)) # pyright: ignore[reportUnknownArgumentType] + + __all__ = [ 'UNITS', 'Constraint', @@ -48,4 +58,5 @@ 'Operator', 'SizeConstraint', 'TextConstraint', + 'format_compact', ] diff --git a/tmt/steps/provision/testcloud.py b/tmt/steps/provision/testcloud.py index efb6c1d46f..6075154302 100644 --- a/tmt/steps/provision/testcloud.py +++ b/tmt/steps/provision/testcloud.py @@ -1594,7 +1594,7 @@ def clean_images(cls, clean: 'tmt.base.core.Clean', dry: bool, workdir_root: Pat for image in testcloud_images.iterdir(): size = image.stat().st_size total_size += size - formatted_size = round(tmt.hardware.UNITS(f'{size} bytes').to_compact(), 1) + formatted_size = tmt.hardware.format_compact(tmt.hardware.UNITS(f'{size} bytes')) if dry: clean.verbose(f"Would remove '{image}' ({formatted_size}).", shift=2) else: @@ -1606,7 +1606,8 @@ def clean_images(cls, clean: 'tmt.base.core.Clean', dry: bool, workdir_root: Pat successful = False clean.verbose( f"Summary: {'Would free' if dry else 'Freed'} " - f"{round(tmt.hardware.UNITS(f'{total_size} bytes').to_compact(), 1)} of disk space.", + f"{tmt.hardware.format_compact(tmt.hardware.UNITS(f'{total_size} bytes'))} " + f"of disk space.", shift=2, ) return successful From afffc0973bb1c990be71d307a6b78ccacde80f82 Mon Sep 17 00:00:00 2001 From: Athrey Vinay Date: Wed, 13 May 2026 13:15:23 +0100 Subject: [PATCH 6/8] address comments... --- tmt/base/core.py | 18 ++++++++++-------- tmt/steps/provision/testcloud.py | 10 +++++----- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/tmt/base/core.py b/tmt/base/core.py index 9d07e6daed..5e8a40e6c0 100644 --- a/tmt/base/core.py +++ b/tmt/base/core.py @@ -75,6 +75,8 @@ from tmt.utils.themes import style if TYPE_CHECKING: + from pint import Quantity + import tmt.cli from tmt.base.plan import Plan from tmt.base.run import Run @@ -3008,9 +3010,9 @@ def show(self) -> None: CleanCallback = Callable[[], bool] -def _dir_size(path: Path) -> int: +def _dir_size(path: Path) -> 'Quantity': """Return the total size in bytes of all files under path.""" - return sum(f.lstat().st_size for f in path.rglob('*')) + return tmt.hardware.UNITS(f'{sum(f.lstat().st_size for f in path.rglob("*"))} bytes') class Clean(tmt.utils.Common): @@ -3160,12 +3162,12 @@ def guests(self, run_ids: tuple[str, ...], keep: Optional[int]) -> bool: successful = False return successful - def _clean_workdir(self, path: Path) -> tuple[bool, int]: + def _clean_workdir(self, path: Path) -> tuple[bool, 'Quantity']: """ Remove a workdir (unless in dry mode) """ size = _dir_size(path) - formatted_size = tmt.hardware.format_compact(tmt.hardware.UNITS(f'{size} bytes')) + formatted_size = tmt.hardware.format_compact(size) if self.is_dry_run: self.verbose(f"Would remove workdir '{path}' ({formatted_size}).", shift=1) else: @@ -3174,7 +3176,7 @@ def _clean_workdir(self, path: Path) -> tuple[bool, int]: shutil.rmtree(path) except OSError as error: self.warn(f"Failed to remove '{path}': {error}.", shift=1) - return False, 0 + return False, tmt.hardware.UNITS('0 bytes') return True, size def runs(self, id_: tuple[str, ...], keep: Optional[int]) -> bool: @@ -3201,16 +3203,16 @@ def runs(self, id_: tuple[str, ...], keep: Optional[int]) -> bool: all_workdirs = all_workdirs[keep:] successful = True - total_size = 0 + total_size = tmt.hardware.UNITS('0 bytes') for workdir in all_workdirs: success, size = self._clean_workdir(workdir) if not success: successful = False - total_size += size + total_size += size # type: ignore[misc] self.verbose( f"Summary: {'Would free' if self.is_dry_run else 'Freed'} " - f"{tmt.hardware.format_compact(tmt.hardware.UNITS(f'{total_size} bytes'))} " + f"{tmt.hardware.format_compact(total_size)} " f"of disk space.", shift=1, ) diff --git a/tmt/steps/provision/testcloud.py b/tmt/steps/provision/testcloud.py index 6075154302..bcba38583b 100644 --- a/tmt/steps/provision/testcloud.py +++ b/tmt/steps/provision/testcloud.py @@ -1590,11 +1590,11 @@ def clean_images(cls, clean: 'tmt.base.core.Clean', dry: bool, workdir_root: Pat clean.warn(f"Directory '{testcloud_images}' does not exist.", shift=2) return True successful = True - total_size = 0 + total_size = tmt.hardware.UNITS('0 bytes') for image in testcloud_images.iterdir(): - size = image.stat().st_size - total_size += size - formatted_size = tmt.hardware.format_compact(tmt.hardware.UNITS(f'{size} bytes')) + size = tmt.hardware.UNITS(f'{image.stat().st_size} bytes') + total_size += size # type: ignore[misc] + formatted_size = tmt.hardware.format_compact(size) if dry: clean.verbose(f"Would remove '{image}' ({formatted_size}).", shift=2) else: @@ -1606,7 +1606,7 @@ def clean_images(cls, clean: 'tmt.base.core.Clean', dry: bool, workdir_root: Pat successful = False clean.verbose( f"Summary: {'Would free' if dry else 'Freed'} " - f"{tmt.hardware.format_compact(tmt.hardware.UNITS(f'{total_size} bytes'))} " + f"{tmt.hardware.format_compact(total_size)} " f"of disk space.", shift=2, ) From eb50b0bdcadfa5195c9090b9697de22435aaef84 Mon Sep 17 00:00:00 2001 From: Athrey Vinay Date: Wed, 13 May 2026 13:40:18 +0100 Subject: [PATCH 7/8] dont consider disk space if image failed to delete... --- tmt/steps/provision/testcloud.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tmt/steps/provision/testcloud.py b/tmt/steps/provision/testcloud.py index bcba38583b..6cd0e6b7d0 100644 --- a/tmt/steps/provision/testcloud.py +++ b/tmt/steps/provision/testcloud.py @@ -1593,10 +1593,10 @@ def clean_images(cls, clean: 'tmt.base.core.Clean', dry: bool, workdir_root: Pat total_size = tmt.hardware.UNITS('0 bytes') for image in testcloud_images.iterdir(): size = tmt.hardware.UNITS(f'{image.stat().st_size} bytes') - total_size += size # type: ignore[misc] formatted_size = tmt.hardware.format_compact(size) if dry: clean.verbose(f"Would remove '{image}' ({formatted_size}).", shift=2) + total_size += size # type: ignore[misc] else: clean.verbose(f"Removing '{image}' ({formatted_size}).", shift=2) try: @@ -1604,6 +1604,8 @@ def clean_images(cls, clean: 'tmt.base.core.Clean', dry: bool, workdir_root: Pat except OSError: clean.fail(f"Failed to remove '{image}'.", shift=2) successful = False + else: + total_size += size # type: ignore[misc] clean.verbose( f"Summary: {'Would free' if dry else 'Freed'} " f"{tmt.hardware.format_compact(total_size)} " From 68725ab0663252a8472db7cb26ae653ca8c596bc Mon Sep 17 00:00:00 2001 From: Athrey Vinay Date: Thu, 14 May 2026 09:35:14 +0100 Subject: [PATCH 8/8] change verbose to info... --- tmt/base/core.py | 2 +- tmt/steps/provision/testcloud.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tmt/base/core.py b/tmt/base/core.py index 5e8a40e6c0..c2c3d2be6e 100644 --- a/tmt/base/core.py +++ b/tmt/base/core.py @@ -3210,7 +3210,7 @@ def runs(self, id_: tuple[str, ...], keep: Optional[int]) -> bool: successful = False total_size += size # type: ignore[misc] - self.verbose( + self.info( f"Summary: {'Would free' if self.is_dry_run else 'Freed'} " f"{tmt.hardware.format_compact(total_size)} " f"of disk space.", diff --git a/tmt/steps/provision/testcloud.py b/tmt/steps/provision/testcloud.py index 6cd0e6b7d0..d49a169d4e 100644 --- a/tmt/steps/provision/testcloud.py +++ b/tmt/steps/provision/testcloud.py @@ -1606,7 +1606,7 @@ def clean_images(cls, clean: 'tmt.base.core.Clean', dry: bool, workdir_root: Pat successful = False else: total_size += size # type: ignore[misc] - clean.verbose( + clean.info( f"Summary: {'Would free' if dry else 'Freed'} " f"{tmt.hardware.format_compact(total_size)} " f"of disk space.",