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)