Skip to content

Commit

Permalink
Merge pull request #46 from ImMin5/142-ms-azure-cost-management-plugi…
Browse files Browse the repository at this point in the history
…n-has-currency-type-set-default-as-krw

Fix default currency can change
  • Loading branch information
ImMin5 authored Feb 6, 2024
2 parents 24a8da0 + 45168b0 commit 17fa4b7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/cloudforet/cost_analysis/manager/data_source_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
azure_cm_connector: AzureCostMgmtConnector = self.locator.get_connector(
"AzureCostMgmtConnector"
)
azure_cm_connector.create_session(options, secret_data, schema)

0 comments on commit 17fa4b7

Please sign in to comment.