mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-06-05 01:33:00 +03:00
coverage
This commit is contained in:
parent
488ff6f551
commit
352d5e6094
@ -162,26 +162,27 @@ class ZfsDataset:
|
|||||||
else:
|
else:
|
||||||
return ZfsDataset(self.zfs_node, self.rstrip_path(1))
|
return ZfsDataset(self.zfs_node, self.rstrip_path(1))
|
||||||
|
|
||||||
def find_prev_snapshot(self, snapshot, also_other_snapshots=False):
|
# NOTE: unused for now
|
||||||
"""find previous snapshot in this dataset. None if it doesn't exist.
|
# def find_prev_snapshot(self, snapshot, also_other_snapshots=False):
|
||||||
|
# """find previous snapshot in this dataset. None if it doesn't exist.
|
||||||
also_other_snapshots: set to true to also return snapshots that where
|
#
|
||||||
not created by us. (is_ours)
|
# also_other_snapshots: set to true to also return snapshots that where
|
||||||
|
# not created by us. (is_ours)
|
||||||
Args:
|
#
|
||||||
:type snapshot: str or ZfsDataset.ZfsDataset
|
# Args:
|
||||||
:type also_other_snapshots: bool
|
# :type snapshot: str or ZfsDataset.ZfsDataset
|
||||||
"""
|
# :type also_other_snapshots: bool
|
||||||
|
# """
|
||||||
if self.is_snapshot:
|
#
|
||||||
raise (Exception("Please call this on a dataset."))
|
# if self.is_snapshot:
|
||||||
|
# raise (Exception("Please call this on a dataset."))
|
||||||
index = self.find_snapshot_index(snapshot)
|
#
|
||||||
while index:
|
# index = self.find_snapshot_index(snapshot)
|
||||||
index = index - 1
|
# while index:
|
||||||
if also_other_snapshots or self.snapshots[index].is_ours():
|
# index = index - 1
|
||||||
return self.snapshots[index]
|
# if also_other_snapshots or self.snapshots[index].is_ours():
|
||||||
return None
|
# return self.snapshots[index]
|
||||||
|
# return None
|
||||||
|
|
||||||
def find_next_snapshot(self, snapshot, also_other_snapshots=False):
|
def find_next_snapshot(self, snapshot, also_other_snapshots=False):
|
||||||
"""find next snapshot in this dataset. None if it doesn't exist
|
"""find next snapshot in this dataset. None if it doesn't exist
|
||||||
|
Loading…
x
Reference in New Issue
Block a user