mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-04-29 23:21:28 +03:00
fix
This commit is contained in:
parent
30c81b4f8a
commit
1dd36b77d6
@ -545,11 +545,10 @@ test_target1/test_source2/fs2/sub@test-20101111000000 canmount - -
|
|||||||
# should fail, now incompatible
|
# should fail, now incompatible
|
||||||
self.assertTrue(ZfsAutobackup("test test_target1 --no-progress --verbose --allow-empty".split(" ")).run())
|
self.assertTrue(ZfsAutobackup("test test_target1 --no-progress --verbose --allow-empty".split(" ")).run())
|
||||||
|
|
||||||
# FIXME: tries to get the guid of the non existing snapshot because of --test mode
|
|
||||||
with mocktime("20101111000003"):
|
with mocktime("20101111000003"):
|
||||||
# --test should succeed by destroying incompatibles
|
# --test should succeed by destroying incompatibles
|
||||||
self.assertFalse(ZfsAutobackup(
|
self.assertFalse(ZfsAutobackup(
|
||||||
"test test_target1 --no-progress --verbose --allow-empty --destroy-incompatible --test --debug".split(
|
"test test_target1 --no-progress --verbose --allow-empty --destroy-incompatible --test".split(
|
||||||
" ")).run())
|
" ")).run())
|
||||||
|
|
||||||
with mocktime("20101111000003"):
|
with mocktime("20101111000003"):
|
||||||
|
@ -1116,9 +1116,14 @@ class ZfsDataset:
|
|||||||
return source_snapshot, target_snapshot
|
return source_snapshot, target_snapshot
|
||||||
|
|
||||||
# Extensive GUID search (slower but works with all names)
|
# Extensive GUID search (slower but works with all names)
|
||||||
|
try:
|
||||||
source_bookmark_snapshot = self.find_guid_bookmark_snapshot(target_snapshot.properties['guid'])
|
source_bookmark_snapshot = self.find_guid_bookmark_snapshot(target_snapshot.properties['guid'])
|
||||||
if source_bookmark_snapshot is not None:
|
if source_bookmark_snapshot is not None:
|
||||||
return source_bookmark_snapshot, target_snapshot
|
return source_bookmark_snapshot, target_snapshot
|
||||||
|
except ExecuteError as e:
|
||||||
|
# in readonly mode we igore a failed property read for non existing snapshots
|
||||||
|
if not self.zfs_node.readonly:
|
||||||
|
raise e
|
||||||
|
|
||||||
raise (Exception("Cant find common bookmark or snapshot with target."))
|
raise (Exception("Cant find common bookmark or snapshot with target."))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user