Part of the plugin activation process uses a list created from content on-disk and their dependencies self.get_plugins_activation_order(), however the list of plugins in self.plugins are only those that were successfully loaded during bootstrap.
A test to determine if the returned plugin is None has been added to log and skip activation of plugins that failed to be loaded for clearer error reporting.
This PR also includes a minor fix for duplicate log entries when calling warn_admins. An info and warning entry were created if a plugin fails to load, but with this patch, a single warning will be created, like the following log sample:
14:58:58 WARNING errbot.plugin_manager Skipping activation for plugin 'Error' because it is not loaded. Check logs for errors while loading the plugin.
14:58:58 DEBUG errbot.plugin_manager Activate flow plugins ...
14:58:58 WARNING errbot.core Some plugins failed to start during bot startup:
Traceback (most recent call last):
File "/opt/errbot/lib/python3.10/site-packages/errbot/plugin_manager.py", line 303, in _load_plugins_generic
dest_dict[name] = self._plugin_instance_callback(name, clazz)
File "/opt/errbot/lib/python3.10/site-packages/errbot/bootstrap.py", line 187, in <lambda>
lambda name, clazz: clazz(bot, name),
TypeError: Example.__init__() takes 1 positional argument but 3 were given
@nzlosh I've fixed the current build issues, however, i cannot seem to get this tests to pass. Could you figure out why the build is failing on this PR?
Part of the plugin activation process uses a list created from content on-disk and their dependencies
self.get_plugins_activation_order()
, however the list of plugins inself.plugins
are only those that were successfully loaded during bootstrap.A test to determine if the returned plugin is
None
has been added to log and skip activation of plugins that failed to be loaded for clearer error reporting.This PR also includes a minor fix for duplicate log entries when calling
warn_admins
. An info and warning entry were created if a plugin fails to load, but with this patch, a single warning will be created, like the following log sample: