avocado: Add a mechanism to skip notifying broken plugins on stderr

Implement a feature to skip notifying broken plugins on
stderr. Let's say a user has a broken plugin that can't
be fixed right now, and he/she doesn't want to be bothered
by having it notified in stderr all the time avocado is
executed, add a configuration option that allows you to
selectively ignore plugins to display errors in stderr.

The reason why the feature is configurable is that we
want users to be notified when a new plugin is present
and for some reason is also broken, this finer grained
control is more useful to users IMHO.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 9acf2a7c
......@@ -19,6 +19,7 @@ import logging
from importlib import import_module
from avocado.core.plugins.plugin import Plugin
from avocado.core.settings import settings
log = logging.getLogger("avocado.app")
......@@ -46,13 +47,17 @@ def load_builtins():
:return: a list of plugin classes, ordered by `priority`.
"""
plugins = []
skip_notify = settings.get_value(section='plugins',
key='skip_broken_plugin_notification',
key_type=list)
for module in Builtins:
try:
plugin_mod = import_module(module)
except Exception as err:
name = str(module)
reason = '%s %s' % (str(err.__class__.__name__), err)
log.error('Error loading %s -> %s', name, reason)
if name not in skip_notify:
log.error('Error loading %s -> %s', name, reason)
ErrorsLoading.append((name, reason))
continue
for name in plugin_mod.__dict__:
......
......@@ -46,3 +46,11 @@ port = 9405
username =
# If authentication is set, pass password
password =
[plugins]
# Suppress notification about broken plugins in the app standard error.
# Add the name of each broken plugin you want to suppress the notification
# in the list. The names can be easily seen from the stderr messages. Example:
# avocado.core.plugins.htmlresult ImportError No module named pystache
# add 'avocado.core.plugins.htmlresult' as an element of the list below.
skip_broken_plugin_notification = []
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册