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

Merge pull request #1056 from dmach/fix-invalid-credentials-manager-traceback

Don't traceback on invalid credentials manager
This commit is contained in:
Daniel Mach 2022-06-24 08:54:11 +02:00 committed by GitHub
commit e6061da1d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -413,7 +413,12 @@ def create_credentials_manager(url, cp):
creds_mgr_cls = config_entry
options = None
mod, cls = creds_mgr_cls.rsplit('.', 1)
return getattr(importlib.import_module(mod), cls).create(cp, options)
try:
creds_mgr = getattr(importlib.import_module(mod), cls).create(cp, options)
except ModuleNotFoundError:
msg = "Invalid credentials_mgr_class: {}".format(creds_mgr_cls)
raise oscerr.ConfigError(msg, conf.config['conffile'])
return creds_mgr
def qualified_name(obj):