storage: make remount async

This commit is contained in:
Girish Ramakrishnan
2022-04-14 07:43:43 -05:00
parent b51082f7e4
commit a39e0ab934
6 changed files with 7 additions and 23 deletions

View File

@@ -281,7 +281,7 @@ function validateBackupTarget(folder) {
async function remount(apiConfig) {
assert.strictEqual(typeof apiConfig, 'object');
if (apiConfig.provider === PROVIDER_FILESYSTEM || apiConfig.provider === PROVIDER_MOUNTPOINT) throw new BoxError(BoxError.NOT_SUPPORTED);
if (apiConfig.provider === PROVIDER_FILESYSTEM || apiConfig.provider === PROVIDER_MOUNTPOINT) return;
await mounts.remount(mounts.mountObjectFromBackupConfig(apiConfig));
}

View File

@@ -262,11 +262,8 @@ function removeDir(apiConfig, pathPrefix) {
return events;
}
function remount(apiConfig, callback) {
async function remount(apiConfig) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof callback, 'function');
return callback(new BoxError(BoxError.NOT_SUPPORTED));
}
function testConfig(apiConfig, callback) {

View File

@@ -140,13 +140,12 @@ function removeDir(apiConfig, pathPrefix) {
return events;
}
function remount(apiConfig, callback) {
async function remount(apiConfig) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof callback, 'function');
// Result: none
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'remount is not implemented'));
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'remount is not implemented');
}
function testConfig(apiConfig, callback) {

View File

@@ -126,11 +126,8 @@ function removeDir(apiConfig, pathPrefix) {
return events;
}
function remount(apiConfig, callback) {
async function remount(apiConfig) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof callback, 'function');
callback(null);
}
function testConfig(apiConfig, callback) {

View File

@@ -457,11 +457,8 @@ function removeDir(apiConfig, pathPrefix) {
return events;
}
function remount(apiConfig, callback) {
async function remount(apiConfig) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof callback, 'function');
return callback(new BoxError(BoxError.NOT_SUPPORTED));
}
function testConfig(apiConfig, callback) {