api_versions.update_headers doesn't set the microversion header if version is 3.0

Bug #1656105 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Invalid
Undecided
Scott DAngelo

Bug Description

Creating a v3 cinderclient via:

https://github.com/openstack/python-cinderclient/blob/1.10.0/cinderclient/client.py#L734

By passing in '3' will create a v3 cinder client class object. The APIVersion is going to be 3.0 because of https://github.com/openstack/python-cinderclient/blob/1.10.0/cinderclient/api_versions.py#L229.

If you're using a keystoneauth1 session, which nova does, then you're going to get here to create a SessionClient:

https://github.com/openstack/python-cinderclient/blob/1.10.0/cinderclient/client.py#L607

When the SessionClient makes a request it updates the headers to put the microversion in the header:

https://github.com/openstack/python-cinderclient/blob/1.10.0/cinderclient/client.py#L109

However, that only happens if the minor version is not 0:

https://github.com/openstack/python-cinderclient/blob/1.10.0/cinderclient/api_versions.py#L310

Which is broken if you're using 3.0.

This is probably a copy/paste error when copying this code from novaclient which doesn't allow microversions for it's 2.0 API. The nova 2.1 API is when we started supporting microversions so novaclient doesn't include a header for microversions when the minor version is 0.

Changed in python-cinderclient:
assignee: nobody → Scott DAngelo (scott-dangelo)
Matt Riedemann (mriedem)
Changed in python-cinderclient:
status: New → Confirmed
Revision history for this message
Scott DAngelo (scott-dangelo) wrote :

The 3.0 version of cinder was designed to be identical to /v2 of the API, so there really wasn't anything microversioned in that. So, similar to Nova, the first effective microversion in Cinder is 3.1.
I can fix the cinderclient to pass the header for 3.0, but I'm not sure if it makes a difference, other than testing.

Revision history for this message
Scott DAngelo (scott-dangelo) wrote :

see http://docs.openstack.org/developer/cinder/devref/api_microversion_history.html

    The 3.0 Cinder API includes all v2 core APIs existing prior to the introduction of microversions. The /v3 URL is used to call 3.0 APIs. This it the initial version of the Cinder API which supports microversions.

    A user can specify a header in the API request:

    OpenStack-API-Version: volume <version>

    where <version> is any valid api version for this API.

    If no version is specified then the API will behave as if version 3.0 was requested.

    The only API change in version 3.0 is versions, i.e. GET http://localhost:8786/, which now returns information about 3.0 and later versions and their respective /v3 endpoints.

    All other 3.0 APIs are functionally identical to version 2.0.

Changed in python-cinderclient:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.