Use dict object for request_specs_dict in the _list_view

The request_specs_dict in the _list_view is initialized as a
defaultdict object in order to return empty string as default.
But the request_spec_dict is replaced with a normal dict object in
the v2.96 microversion, then if server list and RequestSpec missmatch
happens by any reason, the List Server API and the List
Server Detail API hit 500 Internal server error because of key error.

This commit updates the req_spec_dict to use normal dict object, then
it returns sentinel object if there is no appropriate
request_spec object.

Closes-Bug: #2095364
Change-Id: If282b8709954f276cb5d48114437809d771a9958
This commit is contained in:
Masahito Muroi
2025-01-21 10:03:24 +09:00
parent 29d17552a7
commit 509820f156
4 changed files with 98 additions and 11 deletions
+1
View File
@@ -5721,6 +5721,7 @@ pinned_availability_zone:
Also when default_schedule_zone config option set to specific AZ, in that
case, instance would be pinned to that specific AZ, and instance will be
scheduled on host belonging to pinned AZ.
In case of no pinned availability zone, this value is set to `null`.
in: body
type: string
min_version: 2.96