From d27a0e8f4f586027cb5c1327185b9deb0d4a47a5 Mon Sep 17 00:00:00 2001 From: kang2453 Date: Thu, 12 Dec 2024 11:36:24 +0900 Subject: [PATCH] fix: Simplify namespace_id retrieval with assignment expression Signed-off-by: kang2453 --- src/spaceone/inventory_v2/manager/namespace_manager.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/spaceone/inventory_v2/manager/namespace_manager.py b/src/spaceone/inventory_v2/manager/namespace_manager.py index 78b30e9..7fd9a43 100644 --- a/src/spaceone/inventory_v2/manager/namespace_manager.py +++ b/src/spaceone/inventory_v2/manager/namespace_manager.py @@ -22,8 +22,7 @@ def _rollback(vo: Namespace): _LOGGER.info(f"[ROLLBACK] Delete namespace : {vo.name} ({vo.namespace_id}) ({vo.namespace_group_id})") vo.delete() - namespace_id = params.get("namespace_id") - if namespace_id is None: + if namespace_id := params.get("namespace_id"): params["namespace_id"] = utils.generate_id("ns") namespace_vo: Namespace = self.namespace_model.create(params)