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
diff --git a/tempest/test_discover/plugins.py b/tempest/test_discover/plugins.py
index 640b004..58a9905 100644
--- a/tempest/test_discover/plugins.py
+++ b/tempest/test_discover/plugins.py
@@ -88,7 +88,11 @@
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 = []