提交 9d0eaae1 编写于 作者: P Plamen Dimitrov 提交者: Lukáš Doktor

Be a bit more informative about plugin loading failures

Signed-off-by: NPlamen Dimitrov <pdimitrov@pevogam.com>
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 ca6c197c
......@@ -20,6 +20,7 @@ import logging
import os
import re
import sys
import traceback
from six import string_types, iterkeys
......@@ -703,12 +704,16 @@ def log_plugin_failures(failures):
:class:`avocado.core.dispatcher.Dispatcher`
attribute `load_failures`
"""
msg_fmt = 'Failed to load plugin from module "%s": %s'
msg_fmt = 'Failed to load plugin from module "%s": %s :\n%s'
silenced = settings.get_value('plugins',
'skip_broken_plugin_notification',
list, [])
for failure in failures:
if failure[0].module_name in silenced:
continue
if hasattr(failure[1], "__traceback__"):
str_tb = ''.join(traceback.format_tb(failure[1].__traceback__))
else:
str_tb = "Traceback not available"
LOG_UI.error(msg_fmt, failure[0].module_name,
failure[1].__repr__())
failure[1].__repr__(), str_tb)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册