diff --git a/avocado/core/plugins/builtin.py b/avocado/core/plugins/builtin.py index 182681a7852d9356cdfdf7dba3ec361f8270c6b3..711974de1dae41162619969420e254e2af47f23e 100644 --- a/avocado/core/plugins/builtin.py +++ b/avocado/core/plugins/builtin.py @@ -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__: diff --git a/etc/avocado/avocado.conf b/etc/avocado/avocado.conf index 54176225f9867774f72d3ed0a66ba0cee8c99f41..e96bf4914f0291bbe38286d648389d101713a5a3 100644 --- a/etc/avocado/avocado.conf +++ b/etc/avocado/avocado.conf @@ -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 = []