mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
backups: Minor refactoring
Tests: - Adding a remote repository with key and password authentication works with and without encryption. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
2208a7b210
commit
a7ef60015c
@ -330,18 +330,12 @@ class SshBorgRepository(BaseBorgRepository):
|
|||||||
@property
|
@property
|
||||||
def ssh_password(self) -> str | None:
|
def ssh_password(self) -> str | None:
|
||||||
"""Return SSH password if it is stored, otherwise None."""
|
"""Return SSH password if it is stored, otherwise None."""
|
||||||
if 'ssh_password' in self.credentials:
|
return self.credentials.get('ssh_password')
|
||||||
return self.credentials['ssh_password']
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ssh_keyfile(self) -> str | None:
|
def ssh_keyfile(self) -> str | None:
|
||||||
"""Return path to SSH client key if stored, otherwise None."""
|
"""Return path to SSH client key if stored, otherwise None."""
|
||||||
if 'ssh_keyfile' in self.credentials:
|
return self.credentials.get('ssh_keyfile')
|
||||||
return self.credentials['ssh_keyfile']
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _mountpoint(self):
|
def _mountpoint(self):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user