From 686ceff3d9c5ae260eeb1610e2f92f8a90e8b38f Mon Sep 17 00:00:00 2001 From: Youngjin Jo Date: Thu, 26 Sep 2024 17:11:41 +0900 Subject: [PATCH] fix: modify exclude_unset option and database index Signed-off-by: Youngjin Jo --- src/spaceone/identity/manager/role_binding_manager.py | 5 +---- src/spaceone/identity/model/workspace_group/database.py | 2 +- src/spaceone/identity/service/workspace_group_service.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/spaceone/identity/manager/role_binding_manager.py b/src/spaceone/identity/manager/role_binding_manager.py index 57446eb..7d0073e 100644 --- a/src/spaceone/identity/manager/role_binding_manager.py +++ b/src/spaceone/identity/manager/role_binding_manager.py @@ -17,10 +17,7 @@ def __init__(self, *args, **kwargs): def create_role_binding(self, params: dict) -> RoleBinding: def _rollback(vo: RoleBinding): - _LOGGER.info( - f"[create_role_binding._rollback] " - f"Delete trusted service account: {vo.role_binding_id}" - ) + _LOGGER.info(f"[create_role_binding._rollback]: {vo.role_binding_id}") vo.delete() role_binding_vo = self.role_binding_model.create(params) diff --git a/src/spaceone/identity/model/workspace_group/database.py b/src/spaceone/identity/model/workspace_group/database.py index 24f0021..ea3d59c 100644 --- a/src/spaceone/identity/model/workspace_group/database.py +++ b/src/spaceone/identity/model/workspace_group/database.py @@ -48,6 +48,6 @@ class WorkspaceGroup(MongoModel): "change_query_keys": {}, "ordering": ["name"], "indexes": [ - "workspace_group_id", + "name", ], } diff --git a/src/spaceone/identity/service/workspace_group_service.py b/src/spaceone/identity/service/workspace_group_service.py index 0ecb8ac..8a0b5e5 100644 --- a/src/spaceone/identity/service/workspace_group_service.py +++ b/src/spaceone/identity/service/workspace_group_service.py @@ -205,7 +205,7 @@ def add_users( params.users = old_users_in_workspace_group + new_users_in_workspace_group workspace_group_vo = self.workspace_group_mgr.update_workspace_group_by_vo( - params.dict(exclude_unset=False), workspace_group_vo + params.dict(exclude_unset=True), workspace_group_vo ) workspace_group_info = self.add_user_name_and_state_to_users(