From dca1d7a294f7496a88c50ea461fa02e36e209594 Mon Sep 17 00:00:00 2001 From: ImMin5 Date: Wed, 20 Dec 2023 20:56:53 +0900 Subject: [PATCH] feat: add SpaceConnector backend config --- src/spaceone/cost_analysis/conf/global_conf.py | 2 +- .../cost_analysis/manager/notification_manager.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/spaceone/cost_analysis/conf/global_conf.py b/src/spaceone/cost_analysis/conf/global_conf.py index d45ba6e5..20a73857 100644 --- a/src/spaceone/cost_analysis/conf/global_conf.py +++ b/src/spaceone/cost_analysis/conf/global_conf.py @@ -33,7 +33,7 @@ CONNECTORS = { "SpaceConnector": { - "backend": "spaceone.core.connector.space_connector.SpaceConnector", + "backend": "spaceone.core.connector.space_connector:SpaceConnector", "endpoints": { "identity": "grpc://identity:50051", "plugin": "grpc://plugin:50051", diff --git a/src/spaceone/cost_analysis/manager/notification_manager.py b/src/spaceone/cost_analysis/manager/notification_manager.py index d1b3a3ec..7e84b06d 100644 --- a/src/spaceone/cost_analysis/manager/notification_manager.py +++ b/src/spaceone/cost_analysis/manager/notification_manager.py @@ -8,13 +8,12 @@ class NotificationManager(BaseManager): - def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.notification_connector: SpaceConnector = self.locator.get_connector('SpaceConnector', - service='notification', - token=config.get_global('TOKEN')) + self.notification_connector: SpaceConnector = self.locator.get_connector( + "SpaceConnector", service="notification", token=config.get_global("TOKEN") + ) def create_notification(self, message): - _LOGGER.debug(f'Notify message: {message}') - return self.notification_connector.dispatch('Notification.create', message) + _LOGGER.debug(f"Notify message: {message}") + return self.notification_connector.dispatch("Notification.create", message)