mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-11 18:39:30 +00:00
fix: check if repo is initted by checking retcode
This commit is contained in:
parent
ff70a3588e
commit
52336b885d
|
@ -228,8 +228,7 @@ class ResticBackupper(AbstractBackupper):
|
|||
|
||||
def is_initted(self) -> bool:
|
||||
command = self.restic_command(
|
||||
"check",
|
||||
"--json",
|
||||
"unlock",
|
||||
)
|
||||
|
||||
with subprocess.Popen(
|
||||
|
@ -237,10 +236,8 @@ class ResticBackupper(AbstractBackupper):
|
|||
stdout=subprocess.PIPE,
|
||||
shell=False,
|
||||
) as handle:
|
||||
output = handle.communicate()[0].decode("utf-8")
|
||||
if not ResticBackupper.has_json(output):
|
||||
if handle.returncode != 0:
|
||||
return False
|
||||
# raise NotImplementedError("error(big): " + output)
|
||||
return True
|
||||
|
||||
def restored_size(self, snapshot_id: str) -> int:
|
||||
|
|
Loading…
Reference in a new issue