mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-02-02 14:16:38 +00:00
refactor(backup):remove unused verify arg from do_restore
This commit is contained in:
parent
a303e5ce37
commit
fa53264136
|
@ -225,7 +225,7 @@ class ResticBackupper(AbstractBackupper):
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory() as dir:
|
with tempfile.TemporaryDirectory() as dir:
|
||||||
if verify:
|
if verify:
|
||||||
self.do_restore(snapshot_id, target=dir, verify=verify)
|
self._raw_verified_restore(snapshot_id, target=dir)
|
||||||
snapshot_root = dir
|
snapshot_root = dir
|
||||||
else: # attempting inplace restore via mount + sync
|
else: # attempting inplace restore via mount + sync
|
||||||
self.mount_repo(dir)
|
self.mount_repo(dir)
|
||||||
|
@ -244,16 +244,11 @@ class ResticBackupper(AbstractBackupper):
|
||||||
if not verify:
|
if not verify:
|
||||||
self.unmount_repo(dir)
|
self.unmount_repo(dir)
|
||||||
|
|
||||||
def do_restore(self, snapshot_id, target="/", verify=False):
|
def _raw_verified_restore(self, snapshot_id, target="/"):
|
||||||
"""barebones restic restore"""
|
"""barebones restic restore"""
|
||||||
restore_command = self.restic_command(
|
restore_command = self.restic_command(
|
||||||
"restore",
|
"restore", snapshot_id, "--target", target, "--verify"
|
||||||
snapshot_id,
|
|
||||||
"--target",
|
|
||||||
target,
|
|
||||||
)
|
)
|
||||||
if verify:
|
|
||||||
restore_command.append("--verify")
|
|
||||||
|
|
||||||
with subprocess.Popen(
|
with subprocess.Popen(
|
||||||
restore_command, stdout=subprocess.PIPE, shell=False
|
restore_command, stdout=subprocess.PIPE, shell=False
|
||||||
|
|
Loading…
Reference in a new issue