Revert backup policy fallback and check in rest api

Check is now in proper location at backups.testConfig()
This commit is contained in:
Johannes Zellner
2020-05-28 19:50:23 +02:00
parent ea47fb7305
commit b31ac7d1fd
2 changed files with 2 additions and 7 deletions

View File

@@ -386,12 +386,7 @@ function getBackupConfig(callback) {
if (error && error.reason === BoxError.NOT_FOUND) return callback(null, gDefaults[exports.BACKUP_CONFIG_KEY]);
if (error) return callback(error);
var tmp = JSON.parse(value);
// ensure we have a proper retention policy, the rest api checks for validity on settings at the moment
if (!tmp.retentionPolicy || Object.keys(tmp.retentionPolicy).length === 0) tmp.retentionPolicy = gDefaults[exports.BACKUP_CONFIG_KEY].retentionPolicy;
callback(null, tmp); // provider, token, password, region, prefix, bucket
callback(null, JSON.parse(value)); // provider, token, password, region, prefix, bucket
});
}