Let adapter plugins provide configured endpoints
This commit is contained in:
+15
-12
@@ -14,6 +14,7 @@ from .executor import execute_endpoint_plans
|
||||
from .orchestrator import discover_reconcile_plan
|
||||
from .persistence import SQLiteStateStore
|
||||
from .registry import (
|
||||
configured_adapter_endpoints,
|
||||
enabled_plugins,
|
||||
load_adapter,
|
||||
load_provider,
|
||||
@@ -145,20 +146,22 @@ def run_sync(args):
|
||||
|
||||
|
||||
def _configured_adapters(config):
|
||||
enabled = enabled_plugins()
|
||||
adapters = []
|
||||
|
||||
endpoints = []
|
||||
for plugin_name in sorted(enabled_plugins()):
|
||||
for endpoint in configured_adapter_endpoints(
|
||||
plugin_name,
|
||||
config,
|
||||
):
|
||||
adapters.append(
|
||||
load_adapter(
|
||||
plugin_name,
|
||||
config,
|
||||
endpoint,
|
||||
)
|
||||
)
|
||||
|
||||
if "npm" in enabled:
|
||||
endpoints.extend(config.npm_endpoints)
|
||||
|
||||
if "verizon" in enabled:
|
||||
endpoints.extend(config.verizon_endpoints)
|
||||
|
||||
return [
|
||||
load_adapter(endpoint.plugin, config, endpoint)
|
||||
for endpoint in endpoints
|
||||
]
|
||||
return adapters
|
||||
|
||||
|
||||
def run_reconcile(args):
|
||||
|
||||
Reference in New Issue
Block a user