Ask Your Question

python cinderClient api example won't run

asked 2015-12-15 04:15:17 -0500

tzure gravatar image

updated 2015-12-16 09:35:43 -0500

Hi I'm trying to recreate the first example here:

as soon as I reach the "cinder.volumes.list()" line, everything crashes.

here is all the info needed: I issue a token using "openstack token issue". here's the output:

expires    | 2015-12-15T09:09:48.406552Z <br>
id         | aa7a2d59dc714d6c803df5f376b68126<br>

...(the rest is just project id and user id)

so I'm providing the right info to the cinderclient. and still I get this:

>>> cinder.volumes.list()                                                                
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/cinderclient/v1/", line 229, in list
  File "/usr/lib/python2.7/site-packages/cinderclient/", line 65, in _list
    resp, body = self.api.client.get(url)
  File "/usr/lib/python2.7/site-packages/cinderclient/", line 303, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/lib/python2.7/site-packages/cinderclient/", line 260, in _cs_request
  File "/usr/lib/python2.7/site-packages/cinderclient/", line 425, in authenticate
  File "/usr/lib/python2.7/site-packages/cinderclient/", line 469, in _v2_auth
    self._authenticate(url, body)
  File "/usr/lib/python2.7/site-packages/cinderclient/", line 480, in _authenticate
  File "/usr/lib/python2.7/site-packages/cinderclient/", line 249, in request
    raise exceptions.from_response(resp, body)
cinderclient.exceptions.NotFound: The resource could not be found. (HTTP 404)

I'm not sure where to go from here. Do I need to pass other credentials somehow?

Thanks in advance.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-12-16 10:19:56 -0500

tzure gravatar image

updated 2015-12-16 10:20:25 -0500

Solved it. the problem was that the cinder client uses a different api_version.

so the auth_url actually ends with .../v2.0, and not v3

everything works now.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-12-15 04:15:17 -0500

Seen: 348 times

Last updated: Dec 16 '15