mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-23 09:16:51 +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!")
|
raise ValueError("cannot restore without knowing where to!")
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory() as dir:
|
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:
|
for folder in folders:
|
||||||
src = join(dir, folder.strip("/"))
|
src = join(dir, folder.strip("/"))
|
||||||
if not exists(src):
|
if not exists(src):
|
||||||
|
@ -249,6 +249,14 @@ class ResticBackupper(AbstractBackupper):
|
||||||
if "restoring" not in output:
|
if "restoring" not in output:
|
||||||
raise ValueError("cannot restore a snapshot: " + 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:
|
def _load_snapshots(self) -> object:
|
||||||
"""
|
"""
|
||||||
Load list of snapshots from repository
|
Load list of snapshots from repository
|
||||||
|
|
Loading…
Reference in a new issue