discover_version ignores client max supported version

Bug #1826286 reported by Brian Rosmaita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Undecided
Brian Rosmaita

Bug Description

Using a stable/rocky client in a master (Train) devstack:

Python 2.7.12 (default, Nov 12 2018, 14:36:49)
>>> # (skipping auth setup)
>>>
>>> from cinderclient import client
>>> cinder = client.Client('3', session=session)
>>>
>>> # get highest supported mv from client
>>> from cinderclient import api_versions as mv
>>> mv.MAX_VERSION
'3.52'
>>>
>>> # get highest supported mv from server
>>> highest_v = mv.get_highest_version(cinder)
>>> highest_v
<APIVersion: 3.59>
>>>
>>> # discover the max supported version for this session
>>> mv.discover_version(cinder, highest_v)
<APIVersion: 3.59>

Expected to discover that the max supported version is 3.52

The docstring for discover_version() says:
Checks ``requested_version`` and returns the most recent version supported by both the API and the client.

On the plus side, discover_version() doesn't seem to be used anywhere in the code. But as a convenience method for developers, it would be nice for it to be accurate.

Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

Assumning this is a defect, it is currently present in master cinderclient.

Changed in python-cinderclient:
assignee: nobody → Brian Rosmaita (brian-rosmaita)
Changed in python-cinderclient:
status: New → In Progress
Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

Forgot to tag the patch with the bug number, so here it is:
https://review.opendev.org/#/c/655595/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.opendev.org/655595
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=99769753428ba9a5252f1ba0ddb03cca3b8acc95
Submitter: Zuul
Branch: master

commit 99769753428ba9a5252f1ba0ddb03cca3b8acc95
Author: Brian Rosmaita <email address hidden>
Date: Wed Apr 24 21:34:28 2019 -0400

    Correct discover_version response

    The discover_version function was ignoring the max microversion
    supported by the client. This patch corrects its behavior to return
    the most recent API version, if any, supported by both the client
    and the server it is communicating with.

    Closes-bug: #1826286
    Change-Id: If22b72452065080b24cb1b899c5a5a88b809e986

Changed in python-cinderclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-cinderclient 4.3.0

This issue was fixed in the openstack/python-cinderclient 4.3.0 release.

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.