Skip to content

Commit

Permalink
cleaner error output when destroy-incompatible fails
Browse files Browse the repository at this point in the history
  • Loading branch information
psy0rz committed Sep 26, 2023
1 parent f8cd77e commit e30a393
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions zfs_autobackup/ZfsDataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand Down Expand Up @@ -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
"""

Expand All @@ -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:
Expand Down

0 comments on commit e30a393

Please sign in to comment.