Merge "Remove support for 'latest' microversion"

This commit is contained in:
Jenkins 2015-09-11 20:56:47 +00:00 committed by Gerrit Code Review
commit 75fde5a26f
2 changed files with 11 additions and 20 deletions

View File

@ -18,10 +18,6 @@ the ``DEFAULT_API_VERSION`` as defined in
``manila/api/openstack/wsgi.py``. This value is currently ``1.0`` and
is expected to remain so for quite a long time.
There is a special value ``latest`` which can be specified, which will
allow a client to always receive the most recent version of API
responses from the server.
The Nova project was the first to implement microversions. For full
details please read Nova's `Kilo spec for microversions
<http://git.openstack.org/cgit/openstack/nova-specs/tree/specs/kilo/implemented/api-microversions.rst>`_

View File

@ -222,23 +222,18 @@ class Request(webob.Request):
else:
if API_VERSION_REQUEST_HEADER in self.headers:
hdr_string = self.headers[API_VERSION_REQUEST_HEADER]
# 'latest' is a special keyword which is equivalent to
# requesting the maximum version of the API supported
if hdr_string == 'latest':
self.api_version_request = api_version.max_api_version()
else:
self.api_version_request = api_version.APIVersionRequest(
hdr_string)
self.api_version_request = api_version.APIVersionRequest(
hdr_string)
# Check that the version requested is within the global
# minimum/maximum of supported API versions
if not self.api_version_request.matches(
api_version.min_api_version(),
api_version.max_api_version()):
raise exception.InvalidGlobalAPIVersion(
req_ver=self.api_version_request.get_string(),
min_ver=api_version.min_api_version().get_string(),
max_ver=api_version.max_api_version().get_string())
# Check that the version requested is within the global
# minimum/maximum of supported API versions
if not self.api_version_request.matches(
api_version.min_api_version(),
api_version.max_api_version()):
raise exception.InvalidGlobalAPIVersion(
req_ver=self.api_version_request.get_string(),
min_ver=api_version.min_api_version().get_string(),
max_ver=api_version.max_api_version().get_string())
else:
self.api_version_request = api_version.APIVersionRequest(