Skip to content

Commit b230ba7

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Be robust on import plugin module"
2 parents 5311fc3 + 599fa78 commit b230ba7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

openstackclient/common/clientmanager.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,13 @@ def get_plugin_modules(group):
134134
for ep in pkg_resources.iter_entry_points(group):
135135
LOG.debug('Found plugin %r', ep.name)
136136

137-
__import__(ep.module_name)
137+
try:
138+
__import__(ep.module_name)
139+
except Exception:
140+
sys.stderr.write(
141+
"WARNING: Failed to import plugin %r.\n" % ep.name)
142+
continue
143+
138144
module = sys.modules[ep.module_name]
139145
mod_list.append(module)
140146
init_func = getattr(module, 'Initialize', None)

0 commit comments

Comments
 (0)