Merge pull request #17 from strongloop/feature/issue-16

Fix amazon s3 container handling
This commit is contained in:
Raymond Feng 2014-06-26 23:51:23 -07:00
commit 6e7bf6c30d
2 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,11 @@ function patchBaseClass(cls) {
proto._setProperties = function (details) { proto._setProperties = function (details) {
// Use an empty object to receive the calculated properties from details // Use an empty object to receive the calculated properties from details
var receiver = {}; var receiver = {};
// Pass in some context as non-enumerable properties
Object.defineProperties(receiver, {
client: {value: this.client},
files: {value: this.files}
});
m1.call(receiver, details); m1.call(receiver, details);
// Apply the calculated properties to this // Apply the calculated properties to this
for (var p in receiver) { for (var p in receiver) {

View File

@ -64,6 +64,7 @@ StorageService.prototype.getContainers = function (cb) {
StorageService.prototype.createContainer = function (options, cb) { StorageService.prototype.createContainer = function (options, cb) {
options = options || {}; options = options || {};
if ('object' === typeof options && !(options instanceof storage.Container)) { if ('object' === typeof options && !(options instanceof storage.Container)) {
options.Name = options.name; // Amazon expects Name
var Container = factory.getProvider(this.provider).storage.Container; var Container = factory.getProvider(this.provider).storage.Container;
options = new Container(this.client, options); options = new Container(this.client, options);
} }