From 3919fe04a9cad2e5c099eb6f0051448702b2e936 Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Fri, 11 Oct 2024 16:09:59 +0200 Subject: [PATCH] fixes --- tests/test_externalfailures.py | 2 +- zfs_autobackup/ZfsDataset.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_externalfailures.py b/tests/test_externalfailures.py index a76292d..58d26c9 100644 --- a/tests/test_externalfailures.py +++ b/tests/test_externalfailures.py @@ -158,7 +158,7 @@ test_target1/test_source2/fs2/sub@test-20101111000000 # --test try again, should abort old resume with mocktime("20101111000002"): - self.assertFalse(ZfsAutobackup("test test_target1 --no-progress --verbose --test".split(" ")).run()) + self.assertFalse(ZfsAutobackup("test test_target1 --no-progress --verbose --test --debug".split(" ")).run()) # try again, should abort old resume with mocktime("20101111000002"): diff --git a/zfs_autobackup/ZfsDataset.py b/zfs_autobackup/ZfsDataset.py index 51ca223..bf95f65 100644 --- a/zfs_autobackup/ZfsDataset.py +++ b/zfs_autobackup/ZfsDataset.py @@ -692,7 +692,8 @@ class ZfsDataset: def bookmark(self, tag): """Bookmark this snapshot, and return the bookmark. If the bookmark already exist, it returns it.""" - # NOTE: we use the tag to add the target_path GUID, so that we can have multiple bookmarks for the same snapshot, but for different target. This is to make sure you can send a backup to two locations, without them interfering with eachothers bookmarks. + # NOTE: we use the tag to add the target_path GUID, so that we can have multiple bookmarks for the same snapshot, but for different targets. + # This is to make sure you can send a backup to two locations, without them interfering with eachothers bookmarks. if not self.is_snapshot: raise (Exception("Can only bookmark a snapshot!")) @@ -700,7 +701,7 @@ class ZfsDataset: bookmark_name = self.prefix + "#" + self.tagless_suffix + self.zfs_node.tag_seperator + tag # does this exact bookmark (including tag) already exists? - existing_bookmark = self.find_exact_bookmark(bookmark_name) + existing_bookmark = self.parent.find_exact_bookmark(bookmark_name) if existing_bookmark is not None: return existing_bookmark @@ -1423,7 +1424,9 @@ class ZfsDataset: # FIXME: met bookmarks kan de huidige snapshot na send ook meteen weg # FIXME: klopt niet, nu haalt ie altijd bookmark weg? wat als we naar andere target willen senden (zoals in test_encryption.py) if prev_source_snapshot_bookmark and ( + # its an obsolete snapshot? prev_source_snapshot_bookmark in source_obsoletes or ( + # its our bookmark? prev_source_snapshot_bookmark.is_bookmark and prev_source_snapshot_bookmark.tag == bookmark_tag)): prev_source_snapshot_bookmark.destroy()