1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 14:56:14 +01:00

conf: Display apiurl when asking for a username or a password

This commit is contained in:
Daniel Mach 2023-04-11 11:25:24 +02:00
parent cf6e33a59b
commit 5f912a8d7d

View File

@ -987,8 +987,11 @@ def interactive_config_setup(conffile, apiurl, initial=True):
raise oscerr.UserAbort()
print()
user = raw_input('Username: ')
passwd = getpass.getpass()
apiurl_no_scheme = urlsplit(apiurl)[1]
user_prompt = f"Username [{apiurl_no_scheme}]: "
user = raw_input(user_prompt)
pass_prompt = f"Password [{user}@{apiurl_no_scheme}]: "
passwd = getpass.getpass(pass_prompt)
creds_mgr_descr = select_credentials_manager_descr()
if initial:
config = {'user': user, 'pass': passwd}