From c855640f84a1b83b179012b6dd7a98c2eff716f8 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Mon, 18 Mar 2024 14:34:32 -0700 Subject: [PATCH] backups: Adjust to changes in privileged errors Tests: - Unit tests requiring root succeed. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/backups/repository.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plinth/modules/backups/repository.py b/plinth/modules/backups/repository.py index 026d8f5f7..9ec67c134 100644 --- a/plinth/modules/backups/repository.py +++ b/plinth/modules/backups/repository.py @@ -275,7 +275,9 @@ class BaseBorgRepository(abc.ABC): @staticmethod def reraise_known_error(err): """Look whether the caught error is known and reraise it accordingly""" - caught_error = str((err, err.args)) + stdout = getattr(err, 'stdout', b'').decode() + stderr = getattr(err, 'stderr', b'').decode() + caught_error = str((err, err.args, stdout, stderr)) for known_error in KNOWN_ERRORS: for error in known_error['errors']: if re.search(error, caught_error):