From 81d9bf9e500f8e716628eb10690509de22cb8ebd Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 19 Feb 2022 15:19:39 +0100 Subject: vidhar: ... --- modules/zfssnap/zfssnap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/zfssnap/zfssnap.py b/modules/zfssnap/zfssnap.py index 9e8881d0..7daa2935 100644 --- a/modules/zfssnap/zfssnap.py +++ b/modules/zfssnap/zfssnap.py @@ -140,7 +140,7 @@ def prune(config, dry_run): _log_cmd(*args) subprocess.run(args, check=True) -def rename(snapshots): +def rename(snapshots, check=False): args = ['zfs', 'get', '-H', '-p', '-o', 'name,value', 'creation', *snapshots] _log_cmd(*args) with subprocess.Popen(args, stdout=subprocess.PIPE) as proc: @@ -159,7 +159,7 @@ def rename(snapshots): args = ['zfs', 'rename', name, new_name] _log_cmd(*args) - subprocess.run(args, check=True) + subprocess.run(args, check=check) def autosnap(): items = _get_items() @@ -207,7 +207,7 @@ def autosnap(): _log_cmd(*args) subprocess.run(args, check=True) - rename(snapshots=all_snap_names) + rename(snapshots=all_snap_names, check=True) do_snapshot(*single) do_snapshot(*recursive, recursive=True) -- cgit v1.2.3