mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-23 09:16:51 +00:00
fix(backups): actually mount if asked for an inplace restore
This commit is contained in:
parent
9075afd38a
commit
2743441e1e
|
@ -219,9 +219,16 @@ class ResticBackupper(AbstractBackupper):
|
|||
raise ValueError("cannot restore without knowing where to!")
|
||||
|
||||
with tempfile.TemporaryDirectory() as dir:
|
||||
self.do_restore(snapshot_id, target=dir, verify=verify)
|
||||
if verify:
|
||||
self.do_restore(snapshot_id, target=dir, verify=verify)
|
||||
snapshot_root = dir
|
||||
else: # attempting inplace restore via mount + sync
|
||||
self.mount_repo(dir)
|
||||
snapshot_root = join(dir, "ids", snapshot_id)
|
||||
|
||||
assert snapshot_root is not None
|
||||
for folder in folders:
|
||||
src = join(dir, folder.strip("/"))
|
||||
src = join(snapshot_root, folder.strip("/"))
|
||||
if not exists(src):
|
||||
raise ValueError(
|
||||
f"there is no such path: {src}. We tried to find {folder}"
|
||||
|
|
Loading…
Reference in a new issue