Skip to content

Commit c9b77fa

Browse files
committed
Add an additional check for ServiceUnknown DBus error
Signed-off-by: mulhern <[email protected]>
1 parent 7c057ca commit c9b77fa

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/stratis_cli/_error_reporting.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ def get_errors(exc: Exception):
9191
return
9292

9393

94-
def _interpret_errors_0(error):
94+
def _interpret_errors_0(
95+
error: dbus.exceptions.DBusException,
96+
):
9597
"""
9698
Handle match on SCAE .* DBE
9799
where:
@@ -121,7 +123,10 @@ def _interpret_errors_0(error):
121123
# running with a new major version and is supplying a different name on the
122124
# D-Bus than stratis is attempting to use. The second and third
123125
# possibilities are both covered by a single error message.
124-
if error.get_dbus_name() == "org.freedesktop.DBus.Error.NameHasNoOwner":
126+
if error.get_dbus_name() in (
127+
"org.freedesktop.DBus.Error.NameHasNoOwner",
128+
"org.freedesktop.DBus.Error.ServiceUnknown",
129+
):
125130
try:
126131
# pylint: disable=import-outside-toplevel
127132
# isort: THIRDPARTY

0 commit comments

Comments
 (0)