From 34f2c152c24625b90d1cb2f059747a98c6d1e87a Mon Sep 17 00:00:00 2001 From: Joongi Kim Date: Thu, 2 Jul 2020 14:26:43 +0900 Subject: [PATCH] feat: Add "config/plugins/_/" as the home for common plugin configs --- src/ai/backend/common/plugin/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ai/backend/common/plugin/__init__.py b/src/ai/backend/common/plugin/__init__.py index 242210e2..558d0e0f 100644 --- a/src/ai/backend/common/plugin/__init__.py +++ b/src/ai/backend/common/plugin/__init__.py @@ -138,9 +138,10 @@ def discover_plugins( async def init(self) -> None: hook_plugins = self.discover_plugins(self.plugin_group) for plugin_name, plugin_entry in hook_plugins: - plugin_config = await self.etcd.get_prefix( - f"config/plugins/{self._group_key}/{plugin_name}/" - ) + plugin_config = { + **(await self.etcd.get_prefix(f"config/plugins/_/{plugin_name}/")), + **(await self.etcd.get_prefix(f"config/plugins/{self._group_key}/{plugin_name}/")), + } try: plugin_instance = plugin_entry(plugin_config, self.local_config) await plugin_instance.init()