From a4e20a1b825f5162e06cd97ba85d7a49de983279 Mon Sep 17 00:00:00 2001 From: kang2453 Date: Tue, 17 Dec 2024 17:59:14 +0900 Subject: [PATCH] fix: Add new managed namespace for Common Signed-off-by: kang2453 --- src/spaceone/inventory_v2/manager/namespace_manager.py | 2 +- .../inventory_v2/service/namespace_group_service.py | 6 +++--- src/spaceone/inventory_v2/service/namespace_service.py | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/spaceone/inventory_v2/manager/namespace_manager.py b/src/spaceone/inventory_v2/manager/namespace_manager.py index 84b51e5..35ae949 100644 --- a/src/spaceone/inventory_v2/manager/namespace_manager.py +++ b/src/spaceone/inventory_v2/manager/namespace_manager.py @@ -73,7 +73,7 @@ def filter_namespaces(self, **conditions) -> QuerySet: return self.namespace_model.filter(**conditions) def list_namespaces(self, query: dict, domain_id: str) -> Tuple[QuerySet, int]: - # self.create_managed_namespace(domain_id) + self.create_managed_namespace(domain_id) return self.namespace_model.query(**query) def stat_namespaces(self, query: dict) -> dict: diff --git a/src/spaceone/inventory_v2/service/namespace_group_service.py b/src/spaceone/inventory_v2/service/namespace_group_service.py index 585c32a..8643e9a 100644 --- a/src/spaceone/inventory_v2/service/namespace_group_service.py +++ b/src/spaceone/inventory_v2/service/namespace_group_service.py @@ -174,15 +174,15 @@ def get(self, params: NamespaceGroupGetRequest) -> Union[NamespaceGroupResponse, permission="inventory-v2:NamespaceGroup.read", role_types=["DOMAIN_ADMIN", "WORKSPACE_OWNER", "WORKSPACE_MEMBER"], ) + @change_value_by_rule("APPEND", "workspace_id","*") @append_query_filter( [ "namespace_group_id", - "is_managed", + "workspace_id", "domain_id", ] ) @append_keyword_filter(["namespace_group_id", "name"]) - @change_value_by_rule("APPEND", "workspace_id","*") @convert_model def list( self, params: NamespaceGroupSearchQueryRequest @@ -205,7 +205,7 @@ def list( query = params.query or {} namespace_group_vos, total_count = self.namespace_group_mgr.list_namespace_groups( - query, params.domain_id, + query, params.domain_id ) namespaces_group_info = [namespace_group_vo.to_dict() for namespace_group_vo in namespace_group_vos] diff --git a/src/spaceone/inventory_v2/service/namespace_service.py b/src/spaceone/inventory_v2/service/namespace_service.py index 5bb16b2..5168cf8 100644 --- a/src/spaceone/inventory_v2/service/namespace_service.py +++ b/src/spaceone/inventory_v2/service/namespace_service.py @@ -178,6 +178,7 @@ def get(self, params: NamespaceGetRequest) -> Union[NamespaceResponse, dict]: permission="inventory-v2:Namespace.read", role_types=["DOMAIN_ADMIN", "WORKSPACE_OWNER", "WORKSPACE_MEMBER"], ) + @change_value_by_rule("APPEND", "workspace_id","*") @append_query_filter( [ "namespace_id", @@ -185,11 +186,11 @@ def get(self, params: NamespaceGetRequest) -> Union[NamespaceResponse, dict]: "is_managed", "resource_type", "namespace_group_id", + "workspace_id", "domain_id", ] ) @append_keyword_filter(["namespace_id", "name"]) - @change_value_by_rule("APPEND", "workspace_id","*") @convert_model def list( self, params: NamespaceSearchQueryRequest