diff --git a/src/spaceone/plugin/api/v1/plugin.py b/src/spaceone/plugin/api/v1/plugin.py index 67f9d5d..e324726 100644 --- a/src/spaceone/plugin/api/v1/plugin.py +++ b/src/spaceone/plugin/api/v1/plugin.py @@ -1,8 +1,9 @@ -# -*- coding: utf-8 -*- - +import logging from spaceone.api.plugin.v1 import plugin_pb2, plugin_pb2_grpc from spaceone.core.pygrpc import BaseAPI +_LOGGER = logging.getLogger(__name__) + class Plugin(BaseAPI, plugin_pb2_grpc.PluginServicer): @@ -37,6 +38,7 @@ def get_plugin_metadata(self, request, context): with self.locator.get_service('PluginService', metadata) as plugin_svc: metadata = plugin_svc.get_plugin_metadata(params) + _LOGGER.debug(f'[get_plugin_metadata] {metadata}') return self.locator.get_info('PluginMetadata', metadata) def notify_failure(self, request, context): diff --git a/src/spaceone/plugin/info/plugin_info.py b/src/spaceone/plugin/info/plugin_info.py index 828dadf..03595dd 100644 --- a/src/spaceone/plugin/info/plugin_info.py +++ b/src/spaceone/plugin/info/plugin_info.py @@ -1,3 +1,4 @@ +import logging import functools from spaceone.api.plugin.v1 import plugin_pb2 @@ -7,6 +8,8 @@ __all__ = ['PluginInfo', 'PluginsInfo', 'PluginEndpoint', 'PluginMetadata'] +_LOGGER = logging.getLogger(__name__) + def PluginInfo(plugin_vo: InstalledPluginRef, minimal=False): if isinstance(plugin_vo, InstalledPluginRef): @@ -33,7 +36,6 @@ def PluginInfo(plugin_vo: InstalledPluginRef, minimal=False): 'supervisor_id': plugin_vo.supervisor_id, 'managed': True, 'domain_id': plugin_vo.domain_id - } return supervisor_pb2.PluginInfo(**info) @@ -49,4 +51,8 @@ def PluginEndpoint(endpoint): def PluginMetadata(metadata): - return plugin_pb2.PluginMetadata(**metadata) + info = { + 'metadata': change_struct_type(metadata) + } + _LOGGER.debug(f'[PluginMetadata] {info}') + return plugin_pb2.PluginMetadata(**info) diff --git a/src/spaceone/plugin/service/plugin_service.py b/src/spaceone/plugin/service/plugin_service.py index 8c0b6cd..e4cba56 100644 --- a/src/spaceone/plugin/service/plugin_service.py +++ b/src/spaceone/plugin/service/plugin_service.py @@ -58,6 +58,7 @@ def get_plugin_metadata(self, params: dict): plugin_endpoint_info = self._get_plugin_endpoint(params) api_class = self._get_plugin_api_class(plugin_id, domain_id) init_response = self.plugin_mgr.init_plugin(plugin_endpoint_info.get('endpoint'), api_class, {}, domain_id) + _LOGGER.debug(f'[get_plugin_metadata] init_response: {init_response}') return {'metadata': init_response.get('metadata', {})} def _get_plugin_endpoint(self, params):