The attached patch allows for users to choose between the US or UK rackspace datacentre when creating a cloud files container. The correct parameter is then passed to the cloudfiles API.

The datacentre you're tied to is decided depending on where you create an account, i.e. it is not possible to 'migrate' from one to another.

Currently the storage_api always defaults to using the US datacentre making it impossible for UK users to create a container with-out hacking the cloudfiles library.

This patch also fixes the white-screen that happens when you attempt to login to the incorrect datacentre with otherwise valid credentials, see the error message below:

"NOTICE: PHP message: PHP Fatal error:  Call to a member function get_container() on a non-object in /storage_api/services/rackspace.inc on line 169"

Comments

cam8001’s picture

Status:Needs review» Needs work

Patch all looks fine. There are some minor style issues:

+ default: $location = US_AUTHURL;

Probably need to move this onto its own line, see http://drupal.org/coding-standards#controlstruct

+ '#description' => t('The location where you created your rackspace cloud account'),

Should this be capitalised?

Otherwise, +1.

jbrown’s picture

Title:StorageRackspace class fails to pass valid $auth_host parameter for users of the UK datacentre.» StorageRackspace class fails to pass correct $auth_host parameter for UK accounts
Assigned:Unassigned» jbrown
Status:Needs work» Fixed

Thanks for this!

I changed the machine name of the form item to "locality" and the possible values to lowercase. Sorry about that.

The problem with the fatal was that StorageRackspace::serviceSettingsValidate() was not returning early if StorageRackspace::init() failed. I fixed this to be like StorageS3.

http://drupalcode.org/project/storage_api.git/commitdiff/c06568b

jbrown’s picture

What about other countries?

alanmackenzie’s picture

There's only 2 datacenters, other countries simply don't exist as authentication end points.

From the cloudfiles.php file:

define("US_AUTHURL", "https://auth.api.rackspacecloud.com");
define("UK_AUTHURL", "https://lon.auth.api.rackspacecloud.com");

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.