Skip to content

Commit

Permalink
fix: Simplify namespace_id retrieval with assignment expression
Browse files Browse the repository at this point in the history
Signed-off-by: kang2453 <[email protected]>
  • Loading branch information
kang2453 committed Dec 12, 2024
1 parent 5a14127 commit d27a0e8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/spaceone/inventory_v2/manager/namespace_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d27a0e8

Please sign in to comment.