From 95e60fd58a1ae19ad7669ad1b3a0e01e5d99e5f9 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 1 Jul 2025 17:07:50 +0100 Subject: [PATCH] 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 --- nova/api/openstack/compute/keypairs.py | 4 ++-- nova/api/openstack/compute/quota_sets.py | 2 -- nova/api/openstack/compute/server_groups.py | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/nova/api/openstack/compute/keypairs.py b/nova/api/openstack/compute/keypairs.py index af5a115532..29f97e150e 100644 --- a/nova/api/openstack/compute/keypairs.py +++ b/nova/api/openstack/compute/keypairs.py @@ -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'): diff --git a/nova/api/openstack/compute/quota_sets.py b/nova/api/openstack/compute/quota_sets.py index 908f790a3c..7777fc1cf8 100644 --- a/nova/api/openstack/compute/quota_sets.py +++ b/nova/api/openstack/compute/quota_sets.py @@ -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') diff --git a/nova/api/openstack/compute/server_groups.py b/nova/api/openstack/compute/server_groups.py index c69e1c1b0b..953fcee78a 100644 --- a/nova/api/openstack/compute/server_groups.py +++ b/nova/api/openstack/compute/server_groups.py @@ -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")