Skip to content

Commit

Permalink
Merge pull request #20 from ImMin5/master
Browse files Browse the repository at this point in the history
Fix tags value none type error
  • Loading branch information
ImMin5 authored Mar 8, 2024
2 parents 8f47758 + a4255fe commit 5f3b18d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cloudforet/search/model/resource/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ResourceResponse(BaseModel):
resource_id: Union[str, None] = None
name: Union[str, None] = None
description: Union[str, None] = None
tags: dict = {}
tags: Union[dict, None]
domain_id: str
workspace_id: Union[str, None] = None
project_id: Union[str, None] = None
Expand Down
3 changes: 3 additions & 0 deletions src/cloudforet/search/service/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def search(self, params: ResourceSearchRequest) -> Union[ResourcesResponse, dict

response_conf = self.search_conf.get(resource_type).get("response")
response = self._make_response(results, next_token, response_conf)
print(response)

return ResourcesResponse(**response)

Expand Down Expand Up @@ -266,6 +267,8 @@ def _make_response(
result = self._convert_result_by_alias(result, aliases)
if tags:
result = self._add_additional_info_to_tags(result, tags)
else:
result["tags"] = {}

result["name"] = name_format.format(**result)
result["resource_id"] = result[response_conf["resource_id"]]
Expand Down

0 comments on commit 5f3b18d

Please sign in to comment.