From e30a393d0e23b1523896dd88de6ca1a53f7a356b Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Tue, 26 Sep 2023 18:51:24 +0200 Subject: [PATCH] cleaner error output when destroy-incompatible fails --- zfs_autobackup/ZfsDataset.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zfs_autobackup/ZfsDataset.py b/zfs_autobackup/ZfsDataset.py index 8b4fa57..d0cbb6c 100644 --- a/zfs_autobackup/ZfsDataset.py +++ b/zfs_autobackup/ZfsDataset.py @@ -435,7 +435,9 @@ def from_names(self, names, force_exists=None): @CachedProperty def snapshots(self): - """get all snapshots of this dataset""" + """get all snapshots of this dataset + :rtype: ZfsDataset + """ if not self.exists: return [] @@ -1023,7 +1025,7 @@ def handle_incompatible_snapshots(self, incompatible_target_snapshots, destroy_i what to do Args: - :type incompatible_target_snapshots: list of ZfsDataset + :type incompatible_target_snapshots: list[ZfsDataset] :type destroy_incompatible: bool """ @@ -1035,7 +1037,7 @@ def handle_incompatible_snapshots(self, incompatible_target_snapshots, destroy_i else: for snapshot in incompatible_target_snapshots: snapshot.verbose("Incompatible snapshot") - snapshot.destroy() + snapshot.destroy(fail_exception=True) self.snapshots.remove(snapshot) if len(incompatible_target_snapshots)>0: