diff --git a/shepherd/agent/plugin.py b/shepherd/agent/plugin.py index 3fa8298..1a218b2 100644 --- a/shepherd/agent/plugin.py +++ b/shepherd/agent/plugin.py @@ -296,7 +296,7 @@ def load_plugin(plugin_name, plugin_dir=None): # Scan module for load markers left by decorators - for name, attr in module.__dict__.items(): + for attr in module.__dict__.values(): if hasattr(attr, "_shepherd_load_marker"): if isinstance(attr._shepherd_load_marker, FunctionMarker): interface.register_function(attr, **attr._shepherd_load_marker._asdict()) @@ -305,7 +305,7 @@ def load_plugin(plugin_name, plugin_dir=None): if interface._plugin_class is not None: # Scan plugin class for marked methods - for name, attr in interface._plugin_class.__dict__.items(): + for attr in interface._plugin_class.__dict__.values(): if hasattr(attr, "_shepherd_load_marker"): if isinstance(attr._shepherd_load_marker, FunctionMarker): # Instance doesn't exist yet, so need to save unbound methods for binding later @@ -339,7 +339,7 @@ def init_plugins(plugin_configs, core_config): # If it has one, instantiate the plugin object and bind functions if interface._plugin_class is not None: interface._plugin_obj = interface._plugin_class() - for funcname, ifunc in interface._functions.items(): + for ifunc in interface._functions.values(): if ifunc._unbound: ifunc._bind(interface._plugin_obj)