Ask Your Question
0

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: http://docs.openstack.org/developer/python-cinderclient/

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/volumes.py", line 229, in list
    "volumes")
  File "/usr/lib/python2.7/site-packages/cinderclient/base.py", line 65, in _list
    resp, body = self.api.client.get(url)
  File "/usr/lib/python2.7/site-packages/cinderclient/client.py", line 303, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/lib/python2.7/site-packages/cinderclient/client.py", line 260, in _cs_request
    self.authenticate()
  File "/usr/lib/python2.7/site-packages/cinderclient/client.py", line 425, in authenticate
    self._v2_auth(auth_url)
  File "/usr/lib/python2.7/site-packages/cinderclient/client.py", line 469, in _v2_auth
    self._authenticate(url, body)
  File "/usr/lib/python2.7/site-packages/cinderclient/client.py", line 480, in _authenticate
    allow_redirects=True)
  File "/usr/lib/python2.7/site-packages/cinderclient/client.py", 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
1

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 265 times

Last updated: Dec 16 '15