Skip to content

Commit 5fa451a

Browse files
committed
modify getBucketLifeCycle
1 parent b76a071 commit 5fa451a

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

demo/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function getBucketACL() {
9595
if (err) {
9696
return console.log(err);
9797
}
98-
console.log(data.AccessControlList.Grant);
98+
console.log(JSON.stringify(data, null, ' '));
9999
});
100100
}
101101

@@ -512,7 +512,7 @@ function sliceUploadFile() {
512512
});
513513
}
514514

515-
getService();
515+
// getService();
516516
// getAuth();
517517
// putBucket();
518518
// getBucket();

sdk/base.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,10 @@ function getBucketLifecycle(params, callback) {
655655
if (err) {
656656
return callback(err);
657657
}
658-
callback(null, data);
658+
var result = {
659+
Rules: data.LifecycleConfiguration.Rule
660+
};
661+
callback(null, result);
659662
});
660663
}
661664

test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ describe('BucketLifecycle', function () {
527527
Bucket: config.Bucket,
528528
Region: config.Region
529529
}, function (err, data) {
530-
assert(comparePlainObject(Rules, data.LifecycleConfiguration.Rule));
530+
assert(comparePlainObject(Rules, data));
531531
done();
532532
});
533533
}, 50);
@@ -565,7 +565,7 @@ describe('BucketLifecycle', function () {
565565
Bucket: config.Bucket,
566566
Region: config.Region
567567
}, function (err, data) {
568-
assert(comparePlainObject(Rules, data.LifecycleConfiguration.Rule));
568+
assert(comparePlainObject(Rules, data));
569569
done();
570570
});
571571
}, 50);

0 commit comments

Comments
 (0)