cleaner error output when destroy-incompatible fails

This commit is contained in:
Edwin Eefting 2023-09-26 18:51:24 +02:00
parent f8cd77e6e4
commit e30a393d0e
No known key found for this signature in database
GPG Key ID: 0F3C35D8E9887737

View File

@ -435,7 +435,9 @@ class ZfsDataset:
@CachedProperty @CachedProperty
def snapshots(self): def snapshots(self):
"""get all snapshots of this dataset""" """get all snapshots of this dataset
:rtype: ZfsDataset
"""
if not self.exists: if not self.exists:
return [] return []
@ -1023,7 +1025,7 @@ class ZfsDataset:
what to do what to do
Args: Args:
:type incompatible_target_snapshots: list of ZfsDataset :type incompatible_target_snapshots: list[ZfsDataset]
:type destroy_incompatible: bool :type destroy_incompatible: bool
""" """
@ -1035,7 +1037,7 @@ class ZfsDataset:
else: else:
for snapshot in incompatible_target_snapshots: for snapshot in incompatible_target_snapshots:
snapshot.verbose("Incompatible snapshot") snapshot.verbose("Incompatible snapshot")
snapshot.destroy() snapshot.destroy(fail_exception=True)
self.snapshots.remove(snapshot) self.snapshots.remove(snapshot)
if len(incompatible_target_snapshots)>0: if len(incompatible_target_snapshots)>0: