storage: Adjust to changes in privileged errors

Tests:

- Edit auto-mounting to try mounting an already mounted device. In a VM, during
service startup, notice the warning about failure to auto-mount as device is
already mounted.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-03-18 14:39:08 -07:00 committed by James Valleroy
parent cf4f29e848
commit 969d9311ab
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -196,7 +196,7 @@ def _mount(object_path):
try:
privileged.mount(block_device.preferred_device, _log_error=False)
except Exception as exception:
stderr = exception.args[3].decode()
stderr = getattr(exception, 'stderr', b'').decode()
if 'GDBus.Error' not in stderr:
raise