Skip to content

Commit

Permalink
Merge pull request #264 from ImMin5/master
Browse files Browse the repository at this point in the history
Modify update_permission for removing duplicated elements
  • Loading branch information
ImMin5 authored Jul 31, 2024
2 parents 65f2198 + 842b60f commit f3a4847
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ def cost_get_linked_accounts(params: dict) -> dict:
'secret_data': 'dict', # Required
'domain_id': 'str' # Required
}
Returns:
LinkedAccountsResponse: {
'linked_accounts': 'list'
}
"""

pass


Expand Down
11 changes: 8 additions & 3 deletions src/spaceone/cost_analysis/service/data_source_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ def update_permissions(
data_source_id, domain_id
)

deny = params.permissions.get("deny", [])

if deny:
params.permissions["deny"] = list(set(deny))

data_source_vo = self.data_source_mgr.update_data_source_by_vo(
params.dict(exclude_unset=True), data_source_vo
)
Expand Down Expand Up @@ -842,9 +847,9 @@ def _get_data_source_account_vo_map(
)
)
for data_source_account_vo in data_source_account_vos:
data_source_account_vo_map[
data_source_account_vo.account_id
] = data_source_account_vo
data_source_account_vo_map[data_source_account_vo.account_id] = (
data_source_account_vo
)
return data_source_account_vo_map

def _change_filter_connected_workspace_data_source(
Expand Down

0 comments on commit f3a4847

Please sign in to comment.