Handle exceptions from plugins gracefully

If a tempest plugin is poorly constructed and raises an exception
during register_opts this can interfere with the rest of tempest
running correctly. This commit makes the tempest plugin handling
a bit more defensive so things don't crash if a plugin raises an
exception, instead the error is logged and tempest moves on.

Change-Id: Ic133eee1cced5ca3c53334d3d30c7b0b043ff789
This commit is contained in:
Matthew Treinish 2015-10-08 11:10:05 -04:00
parent ba8c22d712
commit 1bc49b951c
1 changed files with 5 additions and 1 deletions

View File

@ -88,7 +88,11 @@ class TempestTestPluginManager(object):
def register_plugin_opts(self, conf):
for plug in self.ext_plugins:
plug.obj.register_opts(conf)
try:
plug.obj.register_opts(conf)
except Exception:
LOG.exception('Plugin %s raised an exception trying to run '
'register_opts' % plug.name)
def get_plugin_options_list(self):
plugin_options = []