diff --git a/errbot/core_plugins/plugins.py b/errbot/core_plugins/plugins.py index 1653afddf9..980431ac81 100644 --- a/errbot/core_plugins/plugins.py +++ b/errbot/core_plugins/plugins.py @@ -127,15 +127,15 @@ def repos_update(self, _, args): if success: yield f"Update of {d} succeeded...\n\n{feedback}\n\n" - plugin = self._bot.plugin_manager.get_plugin_by_path(d) - if hasattr(plugin, "is_activated") and plugin.is_activated: - name = plugin.name - yield f"/me is reloading plugin {name}" - try: - self._bot.plugin_manager.reload_plugin_by_name(plugin.name) - yield f"Plugin {plugin.name} reloaded." - except PluginActivationException as pae: - yield f"Error reactivating plugin {plugin.name}: {pae}" + for plugin in self._bot.plugin_manager.get_plugins_by_path(d): + if hasattr(plugin, "is_activated") and plugin.is_activated: + name = plugin.name + yield f"/me is reloading plugin {name}" + try: + self._bot.plugin_manager.reload_plugin_by_name(plugin.name) + yield f"Plugin {plugin.name} reloaded." + except PluginActivationException as pae: + yield f"Error reactivating plugin {plugin.name}: {pae}" else: yield f"Update of {d} failed...\n\n{feedback}" diff --git a/errbot/plugin_manager.py b/errbot/plugin_manager.py index f273b9bf54..ecab1718e1 100644 --- a/errbot/plugin_manager.py +++ b/errbot/plugin_manager.py @@ -370,6 +370,11 @@ def get_plugin_by_path(self, path): if str(pi.location.parent) == path: return self.plugins[name] + def get_plugins_by_path(self, path): + for name, pi in self.plugin_infos.items(): + if str(pi.location.parent) == path: + yield self.plugins[name] + def deactivate_all_plugins(self): for name in self.get_all_active_plugin_names(): self.deactivate_plugin(name)