提交 e5dd3516 编写于 作者: C Cleber Rosa

Result Plugins: handle exceptions when rendering the results

Previously, a crash in one result plugin could abort the execution
of other plugins and consequently the last parts of the avocado
command line application execution.

Let's handle exceptions that could be raised there, as it's already
being done with Job Pre/Post plugins.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
上级 13039b6f
......@@ -94,3 +94,17 @@ class ResultDispatcher(Dispatcher):
def __init__(self):
super(ResultDispatcher, self).__init__('avocado.plugins.result')
def map_method(self, method_name, result, job):
for ext in self.extensions:
try:
if hasattr(ext.obj, method_name):
method = getattr(ext.obj, method_name)
method(result, job)
except SystemExit:
raise
except KeyboardInterrupt:
raise
except:
job.log.error('Error running method "%s" of plugin "%s": %s',
method_name, ext.name, sys.exc_info()[1])
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册