Skip to content

Commit ae0bad2

Browse files
authored
enable use of autoplot without a keyring definition (Open-MSS#2715)
1 parent ae80a25 commit ae0bad2

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

mslib/utils/mssautoplot.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,19 @@ def close_process_dialog(pdlg):
621621
pdlg.setValue(1)
622622

623623
msc_url = config["mscolab_server_url"]
624-
msc_auth_password = mslib.utils.auth.get_password_from_keyring(service_name=f"MSCOLAB_AUTH_{msc_url}",
625-
username="mscolab")
626-
msc_username = config["MSS_auth"][msc_url]
627-
msc_password = mslib.utils.auth.get_password_from_keyring(service_name=msc_url, username=msc_username)
624+
try:
625+
msc_auth_password = mslib.utils.auth.get_password_from_keyring(service_name=f"MSCOLAB_AUTH_{msc_url}",
626+
username="mscolab")
627+
except KeyError:
628+
msc_auth_password = None
629+
630+
try:
631+
msc_username = config["MSS_auth"][msc_url]
632+
except KeyError:
633+
msc_username = None
634+
msc_password = None
635+
if msc_username is not None:
636+
msc_password = mslib.utils.auth.get_password_from_keyring(service_name=msc_url, username=msc_username)
628637

629638
# Choose view (top or side)
630639
if view == "top":

0 commit comments

Comments
 (0)