mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-12 02:04:04 +02:00
Ask for new credentials when user is missing from an apiurl section in the config file
This commit is contained in:
@@ -1833,7 +1833,9 @@ def get_config(override_conffile=None,
|
|||||||
urls = [i for i in cp.sections() if i != "general"]
|
urls = [i for i in cp.sections() if i != "general"]
|
||||||
for url in urls:
|
for url in urls:
|
||||||
apiurl = sanitize_apiurl(url)
|
apiurl = sanitize_apiurl(url)
|
||||||
username = cp[url]["user"]
|
username = cp[url].get("user", None)
|
||||||
|
if username is None:
|
||||||
|
raise oscerr.ConfigMissingCredentialsError(f"No user found in section {url}", conffile, url)
|
||||||
|
|
||||||
host_options = HostOptions(apiurl=apiurl, username=username, _parent=config)
|
host_options = HostOptions(apiurl=apiurl, username=username, _parent=config)
|
||||||
for name, field in host_options.__fields__.items():
|
for name, field in host_options.__fields__.items():
|
||||||
|
Reference in New Issue
Block a user