mirror of
https://opendev.org/openstack/python-openstackclient.git
synced 2026-01-17 07:20:45 +00:00
Merge "Be robust on import plugin module"
This commit is contained in:
commit
b230ba73cd
1 changed files with 7 additions and 1 deletions
|
|
@ -134,7 +134,13 @@ def get_plugin_modules(group):
|
|||
for ep in pkg_resources.iter_entry_points(group):
|
||||
LOG.debug('Found plugin %r', ep.name)
|
||||
|
||||
__import__(ep.module_name)
|
||||
try:
|
||||
__import__(ep.module_name)
|
||||
except Exception:
|
||||
sys.stderr.write(
|
||||
"WARNING: Failed to import plugin %r.\n" % ep.name)
|
||||
continue
|
||||
|
||||
module = sys.modules[ep.module_name]
|
||||
mod_list.append(module)
|
||||
init_func = getattr(module, 'Initialize', None)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue