mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +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
|
||||
def ssh_password(self) -> str | None:
|
||||
"""Return SSH password if it is stored, otherwise None."""
|
||||
if 'ssh_password' in self.credentials:
|
||||
return self.credentials['ssh_password']
|
||||
|
||||
return None
|
||||
return self.credentials.get('ssh_password')
|
||||
|
||||
@property
|
||||
def ssh_keyfile(self) -> str | None:
|
||||
"""Return path to SSH client key if stored, otherwise None."""
|
||||
if 'ssh_keyfile' in self.credentials:
|
||||
return self.credentials['ssh_keyfile']
|
||||
|
||||
return None
|
||||
return self.credentials.get('ssh_keyfile')
|
||||
|
||||
@property
|
||||
def _mountpoint(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user