From a7ef60015c28df54df307b256c55a48ffd3177fe Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 4 Feb 2026 18:56:55 -0800 Subject: [PATCH] backups: Minor refactoring Tests: - Adding a remote repository with key and password authentication works with and without encryption. Signed-off-by: Sunil Mohan Adapa --- plinth/modules/backups/repository.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/plinth/modules/backups/repository.py b/plinth/modules/backups/repository.py index 77e2aac1f..371e22730 100644 --- a/plinth/modules/backups/repository.py +++ b/plinth/modules/backups/repository.py @@ -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):