Permalink
Browse files

Add the ability to have storage client set alternate serviceType

- Fixes #258
  • Loading branch information...
1 parent 32c634e commit 1abf045b302d26ac36b5c230e09c88a2c8eaba38 @kenperkins kenperkins committed Feb 28, 2014
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/pkgcloud/openstack/storage/storageClient.js
@@ -42,11 +42,17 @@ Client.prototype._getUrl = function (options) {
fragment = urlJoin(fragment, options.path.split('/').map(encodeURIComponent).join('/'));
}
+ var serviceUrl = options.serviceType ? this._identity.getServiceEndpointUrl({
+ serviceType: options.serviceType,
+ region: this.region
+ }) : this._serviceUrl;
+
if (fragment === '' || fragment === '/') {
- return this._serviceUrl;
+ return serviceUrl;
}
- return urlJoin(this._serviceUrl, fragment);
+ return urlJoin(serviceUrl, fragment);
+
};
Client.prototype.serializeMetadata = function (prefix, metadata) {

0 comments on commit 1abf045

Please sign in to comment.