api: Correct expected errors

In Ia5e4c6cadb6c88ccdf7e89566573f1f89087fbe5, we combined multiple
methods into one. However, we got the ranges off by one. Correct this.

We already remove some unnecessary version caps.

Change-Id: I6666101a636b963028fa12dd9caf3cba327bbe5e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane
2025-07-01 17:07:50 +01:00
parent 43d57ae63d
commit 95e60fd58a
3 changed files with 2 additions and 5 deletions

View File

@@ -181,8 +181,8 @@ class KeypairController(wsgi.Controller):
@validation.response_body_schema(schema.index_response, '2.0', '2.1')
@validation.response_body_schema(schema.index_response_v22, '2.2', '2.34')
@validation.response_body_schema(schema.index_response_v235, '2.35')
@wsgi.expected_errors((), '2.0', '2.9')
@wsgi.expected_errors(400, '2.10')
@wsgi.expected_errors((), '2.0', '2.34')
@wsgi.expected_errors(400, '2.35')
def index(self, req):
key_type = False
if api_version_request.is_supported(req, '2.2'):

View File

@@ -110,7 +110,6 @@ class QuotaSetsController(wsgi.Controller):
else:
return []
@wsgi.api_version('2.1')
@wsgi.expected_errors(400)
@validation.query_schema(quota_sets.show_query, '2.0', '2.74')
@validation.query_schema(quota_sets.show_query_v275, '2.75')
@@ -148,7 +147,6 @@ class QuotaSetsController(wsgi.Controller):
self._get_quotas(context, id, user_id=user_id, usages=True),
filtered_quotas=filtered_quotas)
@wsgi.api_version('2.1')
@wsgi.expected_errors(400)
@validation.schema(quota_sets.update, '2.0', '2.35')
@validation.schema(quota_sets.update_v236, '2.36', '2.56')

View File

@@ -175,7 +175,6 @@ class ServerGroupController(wsgi.Controller):
for group in limited_list]
return {'server_groups': result}
@wsgi.api_version("2.1")
@wsgi.expected_errors((400, 403, 409))
@validation.schema(schema.create, "2.0", "2.14")
@validation.schema(schema.create_v215, "2.15", "2.63")