From 4fcf328753b43b7d473ddd43a93acbf5bf64099b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 19 Feb 2022 15:35:17 +0100 Subject: vidhar: ... --- modules/zfssnap/zfssnap.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'modules/zfssnap') diff --git a/modules/zfssnap/zfssnap.py b/modules/zfssnap/zfssnap.py index 46f1b2da..cb91564b 100644 --- a/modules/zfssnap/zfssnap.py +++ b/modules/zfssnap/zfssnap.py @@ -127,9 +127,7 @@ def prune(config, dry_run): all_snaps = {snap['name'] for _, snaps in items.items() for snap in snaps} to_destroy = all_snaps - keep - if to_destroy: - logger.info(f'Will prune: %s', ', '.join(map(lambda snap: f'‘{snap}’', to_destroy))) - else: + if not to_destroy: logger.info('Nothing to prune') for snap in to_destroy: @@ -139,6 +137,7 @@ def prune(config, dry_run): args += [snap] _log_cmd(*args) subprocess.run(args, check=True) + logger.info(f'Pruned ‘{snap}’') def rename(snapshots, destroy=False): args = ['zfs', 'get', '-H', '-p', '-o', 'name,value', 'creation', *snapshots] -- cgit v1.2.3