Make a new Keytoneclient "apiclient.exceptions.Forbidden"

asked 2013-12-03 02:21:22 -0500

changzhi gravatar image

updated 2013-12-03 02:25:42 -0500

I make a new keystoneclient follow by keystoneclient/v2_0/client.py .

from keystoneclient.v2_0 import client as keystone_client
token = keystone_client.Client(username='username',
                           password='password',
                           tenant_name='tenant_name',
                           auth_url='http://10.0.3.139:35357/v2.0/'')
print token.users.list()

The result is :

    Traceback (most recent call last):
  File "list.py", line 15, in <module>
    print token.users.list()
  File "/usr/lib/python2.6/site-packages/keystoneclient/v2_0/users.py", line 120, in list
    return self._list("/users%s" % query, "users")
  File "/usr/lib/python2.6/site-packages/keystoneclient/base.py", line 110, in _list
    resp, body = self.client.get(url)
  File "/usr/lib/python2.6/site-packages/keystoneclient/httpclient.py", line 655, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/lib/python2.6/site-packages/keystoneclient/httpclient.py", line 651, in _cs_request
    **kwargs)
  File "/usr/lib/python2.6/site-packages/keystoneclient/httpclient.py", line 610, in request
    **request_kwargs)
  File "/usr/lib/python2.6/site-packages/keystoneclient/httpclient.py", line 124, in request
    raise exceptions.from_response(resp, method, url)
keystoneclient.apiclient.exceptions.Forbidden: You are not authorized to perform the requested action,    admin_required. (HTTP 403)

I don not know why the problems happens. Could someone tell me how to deal with it ? Thanks a lot !!!!

edit retag flag offensive close merge delete