>>> from novaclient import client>>> c = client.Client(version=2, username='******', api_key='************************', project_id='', auth_url='https://identity.api.rackspacecloud.com/v2.0', service_type='compute')
>>> c.flavors.list()Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/v1_1/flavors.py", line 84, in list
return self._list("/flavors/detail", "flavors")
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/base.py", line 62, in _list
_resp, body = self.api.client.get(url)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 239, in get
return self._cs_request(url, 'GET', **kwargs)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 215, in _cs_request
self.authenticate()
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 360, in authenticate
auth_url = self._v2_auth(auth_url)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 438, in _v2_auth
self._authenticate(url, body)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 449, in _authenticate
resp, body = self._time_request(token_url, "POST", body=body)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 208, in _time_request
resp, body = self.request(url, method, **kwargs)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 202, in request
raise exceptions.from_response(resp, body)
novaclient.exceptions.Unauthorized: Unable to authenticate user with credentials provided. (HTTP 401)
I get a 401 when trying to authenticate to the Rackspace Cloud using novaclient from https://github.com/openstack/python-novaclient.
Note that, though the codesample has an empty string for project_id, I get the same result when project_id is assigned to None, to my Cloud Account Number as an integer, or to my Cloud Account Number as a string.
Thanks
>>> from novaclient import client
>>> c = client.Client(version=2, username='******', api_key='************************', project_id='', auth_url='https://identity.api.rackspacecloud.com/v2.0', service_type='compute')
>>> c.flavors.list()Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/v1_1/flavors.py", line 84, in list
return self._list("/flavors/detail", "flavors")
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/base.py", line 62, in _list
_resp, body = self.api.client.get(url)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 239, in get
return self._cs_request(url, 'GET', **kwargs)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 215, in _cs_request
self.authenticate()
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 360, in authenticate
auth_url = self._v2_auth(auth_url)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 438, in _v2_auth
self._authenticate(url, body)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 449, in _authenticate
resp, body = self._time_request(token_url, "POST", body=body)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 208, in _time_request
resp, body = self.request(url, method, **kwargs)
File "/home/kandinski/.virtualenvs/rackspace/local/lib/python2.7/site-packages/novaclient/client.py", line 202, in request
raise exceptions.from_response(resp, body)
novaclient.exceptions.Unauthorized: Unable to authenticate user with credentials provided. (HTTP 401)