Skip to content

Commit eda7382

Browse files
fix: pass system token to list workspace users method
1 parent 57ac906 commit eda7382

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/spaceone/cost_analysis/manager/identity_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ def list_workspaces(self, params: dict, domain_id: str, token: str = None) -> di
120120
else:
121121
return self.identity_conn.dispatch("Workspace.list", params)
122122

123-
def list_workspace_users(self, params: dict, domain_id: str) -> dict:
124-
if self.token_type == "SYSTEM_TOKEN":
123+
def list_workspace_users(self, params: dict, domain_id: str, token: str = None) -> dict:
124+
if self.token_type == "SYSTEM_TOKEN" or token:
125125
return self.identity_conn.dispatch(
126-
"WorkspaceUser.list", params, x_domain_id=domain_id
126+
"WorkspaceUser.list", params, x_domain_id=domain_id, token=token
127127
)
128128
else:
129129
return self.identity_conn.dispatch("WorkspaceUser.list", params)

src/spaceone/cost_analysis/service/cost_report_serivce.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ def get_email_verified_workspace_owner_users(
440440
return []
441441

442442
# list users in workspace
443+
system_token = config.get_global("TOKEN")
443444
users_info = self.identity_mgr.list_workspace_users(
444445
params={
445446
"workspace_id": workspace_id,
@@ -452,6 +453,7 @@ def get_email_verified_workspace_owner_users(
452453
},
453454
},
454455
domain_id=domain_id,
456+
token=system_token,
455457
).get("results", [])
456458

457459
return users_info

0 commit comments

Comments
 (0)