Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo at exchange data source value #305

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading