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
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 @@ class ZfsDataset:
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 @@ class ZfsDataset:
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: