Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catch DBusErrorResponse #1949

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion mslib/utils/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@
import logging
import keyring


try:
from jeepney.wrappers import DBusErrorResponse
except (ImportError, ModuleNotFoundError):
class DBusErrorResponse(Exception):
"""
Fallback definition on not DBus systems
"""
def __init__(self, message):
super().__init__(message)

from mslib.msui import constants


Expand Down Expand Up @@ -64,7 +75,7 @@ def get_password_from_keyring(service_name=NAME, username=""):
return None
else:
return cred.password
except (keyring.errors.KeyringLocked, keyring.errors.InitError) as ex:
except (keyring.errors.KeyringLocked, keyring.errors.InitError, DBusErrorResponse) as ex:
logging.warn(ex)
return None

Expand Down