mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-23 01:06:43 +00:00
feature(backups): check restore exit code
This commit is contained in:
parent
3dc6fb91f2
commit
03313b739a
|
@ -219,7 +219,7 @@ class ResticBackupper(AbstractBackupper):
|
|||
raise ValueError("cannot restore without knowing where to!")
|
||||
|
||||
with tempfile.TemporaryDirectory() as dir:
|
||||
self.do_restore(snapshot_id, target=dir)
|
||||
self.do_restore(snapshot_id, target=dir, verify=verify)
|
||||
for folder in folders:
|
||||
src = join(dir, folder.strip("/"))
|
||||
if not exists(src):
|
||||
|
@ -249,6 +249,14 @@ class ResticBackupper(AbstractBackupper):
|
|||
if "restoring" not in output:
|
||||
raise ValueError("cannot restore a snapshot: " + output)
|
||||
|
||||
assert (
|
||||
handle.returncode is not None
|
||||
) # none should be impossible after communicate
|
||||
if handle.returncode != 0:
|
||||
raise ValueError(
|
||||
"restore exited with errorcode", returncode, ":", output
|
||||
)
|
||||
|
||||
def _load_snapshots(self) -> object:
|
||||
"""
|
||||
Load list of snapshots from repository
|
||||
|
|
Loading…
Reference in a new issue