Compare commits

...

1 Commits

Author SHA1 Message Date
Rahul Padigela b6bb53ae4f ft: support multiple storage classes 2017-12-19 16:52:43 -08:00
1 changed files with 4 additions and 3 deletions

View File

@ -283,8 +283,10 @@ class ReplicationConfiguration {
_parseStorageClass(destination) { _parseStorageClass(destination) {
const storageClass = destination.StorageClass && const storageClass = destination.StorageClass &&
destination.StorageClass[0]; destination.StorageClass[0];
const storageClassArr = storageClass.split(',');
if (!this._config) { if (!this._config) {
return validStorageClasses.includes(storageClass); return storageClassArr.every(i => validStorageClasses.includes(i));
} }
const replicationEndpoints = this._config.replicationEndpoints const replicationEndpoints = this._config.replicationEndpoints
.map(endpoint => endpoint.site); .map(endpoint => endpoint.site);
@ -304,7 +306,6 @@ class ReplicationConfiguration {
!validStorageClasses.includes(storageClass)) { !validStorageClasses.includes(storageClass)) {
return errors.MalformedXML; return errors.MalformedXML;
} }
this._prevStorageClass = storageClass;
return undefined; return undefined;
} }
@ -357,7 +358,7 @@ class ReplicationConfiguration {
if (!dest) { if (!dest) {
return errors.MalformedXML; return errors.MalformedXML;
} }
const err = this._parseBucket(dest) || this._parseStorageClass(dest); const err = this._parseBucket(dest) || this._parseStorageClasses(dest);
if (err) { if (err) {
return err; return err;
} }