diff --git a/osc/conf.py b/osc/conf.py index c18b876e..29dcb670 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -1833,7 +1833,9 @@ def get_config(override_conffile=None, urls = [i for i in cp.sections() if i != "general"] for url in urls: 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) for name, field in host_options.__fields__.items():