Skip to content

Commit

Permalink
fix(cli): use new entry point method (#5623)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 authored Dec 17, 2024
1 parent d4cef1b commit 8321484
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/dispatch/common/utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@

logger = logging.getLogger(__name__)


# Plugin endpoints should determine authentication # TODO allow them to specify (kglisson)
def install_plugin_events(api):
"""Adds plugin endpoints to the event router."""
for plugin in plugins.all():
if plugin.events:
api.include_router(plugin.events, prefix="/{organization}/events", tags=["events"])


def install_plugins():
"""
Installs plugins associated with dispatch
:return:
"""
# Retrieve entry points for 'dispatch.plugins'
dispatch_plugins = entry_points().get("dispatch.plugins", [])
"""Installs plugins associated with dispatch"""
dispatch_plugins = entry_points().select(group="dispatch.plugins")

for ep in dispatch_plugins:
logger.info(f"Attempting to load plugin: {ep.name}")
Expand Down

0 comments on commit 8321484

Please sign in to comment.