Skip to content

Commit

Permalink
fix: Remove change_value_by_rule annotation from update and delete me…
Browse files Browse the repository at this point in the history
…thods

Signed-off-by: lhhyung <[email protected]>
  • Loading branch information
lhhyung committed Dec 11, 2024
1 parent dd8c67c commit 5a71536
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/spaceone/inventory_v2/service/region_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def create(self, params: RegionCreateRequest) -> Union[RegionResponse, dict]:
"""
Args:
params (dict): {
'region_id': 'str,
'name': 'str', # required
'region_code': 'str', # required
'provider': 'str', # required
Expand All @@ -48,13 +47,10 @@ def create(self, params: RegionCreateRequest) -> Union[RegionResponse, dict]:
"""
region_vo = self.create_resource(params.dict())

# return self.create_resource(params)
return RegionResponse(**region_vo.to_dict())

def create_resource(self, params: dict) -> Region:

identity_mgr = IdentityManager()

domain_id = params["domain_id"]
workspace_id = params.get("workspace_id")
resource_group = params["resource_group"]
Expand All @@ -64,6 +60,7 @@ def create_resource(self, params: dict) -> Region:
if workspace_id is None:
raise ERROR_REQUIRED_PARAMETER(key="workspace_id")

identity_mgr = IdentityManager()
identity_mgr.check_workspace(workspace_id, domain_id)
else:
params["workspace_id"] = "*"
Expand All @@ -78,7 +75,6 @@ def create_resource(self, params: dict) -> Region:
permission="inventory-v2:Region.write",
role_types=["DOMAIN_ADMIN", "WORKSPACE_OWNER"],
)
@change_value_by_rule("APPEND", "workspace_id", "*")
@convert_model
def update(self, params: RegionUpdateRequest) -> Union[RegionResponse, dict]:
"""
Expand Down Expand Up @@ -110,7 +106,6 @@ def update_resource(self, params: dict) -> Region:
permission="inventory-v2:Region.write",
role_types=["DOMAIN_ADMIN", "WORKSPACE_OWNER"],
)
@change_value_by_rule("APPEND", "workspace_id", "*")
@convert_model
def delete(self, params: RegionDeleteRequest) -> None:
"""
Expand Down

0 comments on commit 5a71536

Please sign in to comment.