diff options
-rw-r--r-- | modules/zfssnap/zfssnap.py | 6 |
1 files 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): | |||
140 | _log_cmd(*args) | 140 | _log_cmd(*args) |
141 | subprocess.run(args, check=True) | 141 | subprocess.run(args, check=True) |
142 | 142 | ||
143 | def rename(snapshots): | 143 | def rename(snapshots, check=False): |
144 | args = ['zfs', 'get', '-H', '-p', '-o', 'name,value', 'creation', *snapshots] | 144 | args = ['zfs', 'get', '-H', '-p', '-o', 'name,value', 'creation', *snapshots] |
145 | _log_cmd(*args) | 145 | _log_cmd(*args) |
146 | with subprocess.Popen(args, stdout=subprocess.PIPE) as proc: | 146 | with subprocess.Popen(args, stdout=subprocess.PIPE) as proc: |
@@ -159,7 +159,7 @@ def rename(snapshots): | |||
159 | 159 | ||
160 | args = ['zfs', 'rename', name, new_name] | 160 | args = ['zfs', 'rename', name, new_name] |
161 | _log_cmd(*args) | 161 | _log_cmd(*args) |
162 | subprocess.run(args, check=True) | 162 | subprocess.run(args, check=check) |
163 | 163 | ||
164 | def autosnap(): | 164 | def autosnap(): |
165 | items = _get_items() | 165 | items = _get_items() |
@@ -207,7 +207,7 @@ def autosnap(): | |||
207 | 207 | ||
208 | _log_cmd(*args) | 208 | _log_cmd(*args) |
209 | subprocess.run(args, check=True) | 209 | subprocess.run(args, check=True) |
210 | rename(snapshots=all_snap_names) | 210 | rename(snapshots=all_snap_names, check=True) |
211 | 211 | ||
212 | do_snapshot(*single) | 212 | do_snapshot(*single) |
213 | do_snapshot(*recursive, recursive=True) | 213 | do_snapshot(*recursive, recursive=True) |