mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-04-17 22:52:20 +03:00
destroys no longer fatal
This commit is contained in:
parent
29078b7c04
commit
48ff1f7d2f
@ -626,11 +626,19 @@ class ZfsDataset():
|
||||
self.exists=1
|
||||
|
||||
|
||||
def destroy(self):
|
||||
def destroy(self, fail_exception=False):
|
||||
"""destroy the dataset. by default failures are not an exception, so we can continue making backups"""
|
||||
self.verbose("Destroying")
|
||||
self.zfs_node.run(["zfs", "destroy", self.name])
|
||||
self.invalidate()
|
||||
self.force_exists=False
|
||||
try:
|
||||
self.zfs_node.run(["zfs", "destroy", self.name])
|
||||
self.invalidate()
|
||||
self.force_exists=False
|
||||
return(True)
|
||||
except:
|
||||
if not fail_exception:
|
||||
return(False)
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
@cached_property
|
||||
|
Loading…
x
Reference in New Issue
Block a user