From 45168b025e1952569b992234763800bc9cd474c2 Mon Sep 17 00:00:00 2001 From: ImMin5 Date: Wed, 7 Feb 2024 00:35:25 +0900 Subject: [PATCH] fix: fix default currency can change Signed-off-by: ImMin5 --- .../manager/data_source_manager.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/cloudforet/cost_analysis/manager/data_source_manager.py b/src/cloudforet/cost_analysis/manager/data_source_manager.py index 065f2e2..fb49bb1 100644 --- a/src/cloudforet/cost_analysis/manager/data_source_manager.py +++ b/src/cloudforet/cost_analysis/manager/data_source_manager.py @@ -2,22 +2,25 @@ from spaceone.core.manager import BaseManager from cloudforet.cost_analysis.model.data_source_model import PluginMetadata -from cloudforet.cost_analysis.connector.azure_cost_mgmt_connector import AzureCostMgmtConnector +from cloudforet.cost_analysis.connector.azure_cost_mgmt_connector import ( + AzureCostMgmtConnector, +) _LOGGER = logging.getLogger(__name__) class DataSourceManager(BaseManager): - @staticmethod def init_response(options): plugin_metadata = PluginMetadata() + if currency := options.get("currency"): + plugin_metadata.currency = currency plugin_metadata.validate() - return { - 'metadata': plugin_metadata.to_primitive() - } + return {"metadata": plugin_metadata.to_primitive()} def verify_plugin(self, options, secret_data, schema): - azure_cm_connector: AzureCostMgmtConnector = self.locator.get_connector('AzureCostMgmtConnector') - azure_cm_connector.create_session(options, secret_data, schema) \ No newline at end of file + azure_cm_connector: AzureCostMgmtConnector = self.locator.get_connector( + "AzureCostMgmtConnector" + ) + azure_cm_connector.create_session(options, secret_data, schema)