discover_version ignores client max supported version

Bug #1826286 reported by Brian Rosmaita on 2019-04-24
This bug affects 1 person
Affects Status Importance Assigned to Milestone
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
>>> # 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.

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
Brian Rosmaita (brian-rosmaita) wrote :

Forgot to tag the patch with the bug number, so here it is:

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

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  Edit
Everyone can see this information.

Other bug subscribers