Search This Blog

Saturday, April 6, 2013

Authentication issue with London cloud account when using Pyrax module

The Python pyrax module is a Rackspace library that integrates various python modules like  python-novaclient to allow a user to use Openstack API with Rackspace cloud. An introduction how to start with it can be found here: pyrax – Python Bindings for the Rackspace Cloud

A simple script that lists currently existed cloud server is below. For more examples and API documentation please refer to the github directories:


By default an execution of the script generate this error:
Traceback (most recent call last):
  File "C:\Users\radoslaw\workspace\api-challenge\", line 6, in <module>
  File "c:\Python27\lib\site-packages\pyrax\", line 215, in set_credential_file
  File "c:\Python27\lib\site-packages\pyrax\", line 108, in set_credential_file
  File "c:\Python27\lib\site-packages\pyrax\", line 138, in authenticate
    raise exc.AuthenticationFailed("Incorrect/unauthorized "
pyrax.exceptions.AuthenticationFailed: Incorrect/unauthorized credentials received

By default the function pyrax.set_credential_file(conf)  assumes your cloud account belongs to the USA. For it to work you need to specify the LONDON region like in the commented code above.

pyrax.set_credential_file(conf, "LON")

No comments:

Post a Comment