API version validation error

Bug #1227307 reported by Isao Yangimachi
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Undecided
Jay Bryant

Bug Description

The cinder endpoint is as below –

https://10.10.10.1/rest/volume/v1/b121dfa2121121212..

In the module cinderclient.client.py, there is section of code as below –

 def get_volume_api_version_from_endpoint(self):
        magic_tuple = urlparse.urlsplit(self.management_url)
        scheme, netloc, path, query, frag = magic_tuple
       ----> v = path.split("/")[1] <------------------------------------------------------
        valid_versions = ['v1', 'v2']
        if v not in valid_versions:
            msg = "Invalid client version '%s'. must be one of: %s" % (
                  (v, ', '.join(valid_versions)))
            raise exceptions.UnsupportedVersion(msg)
        return v[1:]

The above method splits the “path” section of publicURL (/rest/volume/v1…) and picks the value at index 1.
However, in the cinder endpoint(https://10.10.10.1/rest/volume/v1/b121dfa2121121212..) , the value at that position ends up being ‘rest’ and hence the version check fails.

This issue was reported (https://answers.launchpad.net/cinder/+question/234710), but never answered.

description: updated
Changed in python-cinderclient:
assignee: nobody → Jenny Shieh (jenny-shieh)
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/47624

Changed in python-cinderclient:
status: New → In Progress
Changed in python-cinderclient:
assignee: Jenny Shieh (jenny-shieh) → Jay Bryant (jsbryant)
Jay Bryant (jsbryant)
tags: added: havana-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/47624
Committed: http://github.com/openstack/python-cinderclient/commit/f96dcd714e494dc31612e01a9927beded691e2e8
Submitter: Jenkins
Branch: master

commit f96dcd714e494dc31612e01a9927beded691e2e8
Author: jenny-shieh <email address hidden>
Date: Fri Sep 20 12:28:45 2013 -0700

    Fix the failure of fetching the version in cinder endpoint

    To search for verion in cinder endpoint string, instead of using
    hard code position

    Implements: search for verion in cinder endpoint string
    Closes-Bug: #1227307
    Change-Id: Ie38806ad995e6fd49155f448abf9b2ef43f24a0e

Changed in python-cinderclient:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
tags: removed: havana-rc-potential
Changed in python-cinderclient:
milestone: none → 1.3.1
status: Fix Committed → Fix Released
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.