Skip to content

Commit

Permalink
feat: modify budget create api
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMin5 committed Dec 20, 2023
1 parent f8dfb8c commit d5312e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/spaceone/cost_analysis/manager/data_source_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def deregister_data_source(self, data_source_id, domain_id):
def deregister_data_source_by_vo(data_source_vo):
data_source_vo.delete()

def get_data_source(self, data_source_id: str, workspace_id=None):
conditions = {"data_source_id": data_source_id}
def get_data_source(self, data_source_id: str, domain_id: str, workspace_id=None):
conditions = {"data_source_id": data_source_id, "domain_id": domain_id}

if workspace_id:
conditions["workspace_id"] = workspace_id
Expand Down
4 changes: 3 additions & 1 deletion src/spaceone/cost_analysis/service/budget_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def create(self, params):
data_source_mgr: DataSourceManager = self.locator.get_manager(
"DataSourceManager"
)
data_source_vo: DataSource = data_source_mgr.get_data_source(data_source_id)
data_source_vo: DataSource = data_source_mgr.get_data_source(
data_source_id, domain_id
)
data_source_metadata = data_source_vo.plugin_info.metadata
params["currency"] = data_source_metadata.get("currency", "USD")

Expand Down

0 comments on commit d5312e6

Please sign in to comment.