Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
whdalsrnt committed Oct 20, 2024
2 parents 1e6a556 + dffb77e commit 22e5135
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/spaceone/cost_analysis/manager/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _get_default_unified_cost_config() -> dict:
"run_hour": config.get_global("UNIFIED_COST_RUN_HOUR", 0),
"aggregation_day": config.get_global("UNIFIED_COST_AGGREGATION_DAY", 15),
"is_last_day": False,
"exchange_source": "Yahoo Finance!",
"exchange_source": "Yahoo! Finance",
"exchange_date": 15,
"is_exchange_last_day": False,
"exchange_rate_mode": "AUTO",
Expand Down
11 changes: 11 additions & 0 deletions src/spaceone/cost_analysis/service/cost_query_set_service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import logging

from spaceone.core.service import *

from spaceone.cost_analysis.manager import DataSourceManager
from spaceone.cost_analysis.manager.cost_query_set_manager import CostQuerySetManager
from spaceone.cost_analysis.model.cost_query_set_model import CostQuerySet

Expand All @@ -16,6 +18,7 @@ class CostQuerySetService(BaseService):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.data_source_mgr: DataSourceManager = DataSourceManager()
self.cost_query_set_mgr: CostQuerySetManager = self.locator.get_manager(
"CostQuerySetManager"
)
Expand Down Expand Up @@ -44,6 +47,14 @@ def create(self, params):
cost_query_set_vo (object)
"""

domain_id = params["domain_id"]
data_source_id = params["data_source_id"]

if data_source_id != "unified-cost-data-source":
self.data_source_mgr.get_data_source(
domain_id=domain_id, data_source_id=data_source_id
)

return self.cost_query_set_mgr.create_cost_query_set(params)

@transaction(
Expand Down
2 changes: 1 addition & 1 deletion src/spaceone/cost_analysis/service/unified_cost_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def run_unified_cost(self, params: dict):
currency_map, exchange_date = currency_mgr.get_currency_map_date(
currency_end_date=exchange_date
)
exchange_source = "Yahoo Finance!"
exchange_source = "Yahoo! Finance"
else:
currency_map = unified_cost_config["custom_exchange_rate"]
exchange_source = unified_cost_config.get("exchange_source", "MANUAL")
Expand Down

0 comments on commit 22e5135

Please sign in to comment.