get_server_version does not handle older (non-v3) servers

Bug #1694729 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Medium
John Griffith

Bug Description

This method is checking for the v3 API:

https://github.com/openstack/python-cinderclient/blob/2.1.0/cinderclient/client.py#L88

But if this is talking to an older cinder server which doesn't have the v3 API then the for loop is going to complete and return None, which could lead to a NoneType here:

https://github.com/openstack/python-cinderclient/blob/2.1.0/cinderclient/client.py#L100

The for loop should probably have an else that raises ClientException so it defaults to return 2.0.

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

Fix proposed to branch: master
Review: https://review.openstack.org/469520

Changed in python-cinderclient:
assignee: nobody → John Griffith (john-griffith)
status: New → In Progress
Matt Riedemann (mriedem)
Changed in python-cinderclient:
importance: Undecided → Medium
tags: added: ocata-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/469520
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=7547e55bbebfeb4232968780cfed4d9a448594ae
Submitter: Jenkins
Branch: master

commit 7547e55bbebfeb4232968780cfed4d9a448594ae
Author: j-griffith <email address hidden>
Date: Wed May 31 08:44:07 2017 -0600

    cinderclient might not return version for V2 API

    The get_server_version call in cidnerclient/client.py relies on
    either finding v 3.x or encountering an exception to revert back
    to v 2.0. It's not clear that this call will always raise if
    a non V3 capable Cinder is called, so just to be safe make sure
    we return a 2.0 response if there's no V3 reported back.

    Change-Id: I3b5fb895cad4b85d5f4ea286fb33f7dd0929e691
    Closes-Bug: #1694729

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 3.1.0

This issue was fixed in the openstack/python-cinderclient 3.1.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.