mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
backups: Adjust to changes in privileged errors
Tests: - Unit tests requiring root succeed. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
ade2d0c8f2
commit
c855640f84
@ -275,7 +275,9 @@ class BaseBorgRepository(abc.ABC):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def reraise_known_error(err):
|
def reraise_known_error(err):
|
||||||
"""Look whether the caught error is known and reraise it accordingly"""
|
"""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 known_error in KNOWN_ERRORS:
|
||||||
for error in known_error['errors']:
|
for error in known_error['errors']:
|
||||||
if re.search(error, caught_error):
|
if re.search(error, caught_error):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user