diff --git a/src/backups.js b/src/backups.js index d5c15214d..9498bb56f 100644 --- a/src/backups.js +++ b/src/backups.js @@ -362,10 +362,9 @@ async function remount(auditSource) { const backupConfig = await getConfig(); - const func = storage.api(backupConfig.provider); - if (!func) throw new BoxError(BoxError.BAD_FIELD, 'unknown storage provider'); - - await storage.api(backupConfig.provider).remount(backupConfig); + if (mounts.isManagedProvider(backupConfig.provider)) { + await mounts.remount(mounts.mountObjectFromBackupConfig(backupConfig)); + } } async function getMountStatus() { diff --git a/src/storage/filesystem.js b/src/storage/filesystem.js index 03f74e5f7..39f678242 100644 --- a/src/storage/filesystem.js +++ b/src/storage/filesystem.js @@ -16,8 +16,6 @@ exports = module.exports = { remove, removeDir, - remount, - testConfig, removePrivateFields, injectPrivateFields @@ -254,14 +252,6 @@ function validateBackupTarget(folder) { return null; } -async function remount(apiConfig) { - assert.strictEqual(typeof apiConfig, 'object'); - - if (apiConfig.provider === PROVIDER_FILESYSTEM || apiConfig.provider === PROVIDER_MOUNTPOINT) return; - - await mounts.remount(mounts.mountObjectFromBackupConfig(apiConfig)); -} - async function testConfig(apiConfig) { assert.strictEqual(typeof apiConfig, 'object'); diff --git a/src/storage/gcs.js b/src/storage/gcs.js index 536776d06..17893a9da 100644 --- a/src/storage/gcs.js +++ b/src/storage/gcs.js @@ -15,8 +15,6 @@ exports = module.exports = { remove, removeDir, - remount, - testConfig, removePrivateFields, injectPrivateFields, @@ -238,10 +236,6 @@ async function removeDir(apiConfig, pathPrefix, progressCallback) { progressCallback({ progress: `Deleted ${total} files` }); } -async function remount(apiConfig) { - assert.strictEqual(typeof apiConfig, 'object'); -} - async function testConfig(apiConfig) { assert.strictEqual(typeof apiConfig, 'object'); diff --git a/src/storage/interface.js b/src/storage/interface.js index deee5998f..6a01a64ee 100644 --- a/src/storage/interface.js +++ b/src/storage/interface.js @@ -27,8 +27,6 @@ exports = module.exports = { remove, removeDir, - remount, - testConfig, removePrivateFields, injectPrivateFields @@ -129,14 +127,6 @@ async function removeDir(apiConfig, pathPrefix, progressCallback) { throw new BoxError(BoxError.NOT_IMPLEMENTED, 'removeDir is not implemented'); } -async function remount(apiConfig) { - assert.strictEqual(typeof apiConfig, 'object'); - - // Result: none - - throw new BoxError(BoxError.NOT_IMPLEMENTED, 'remount is not implemented'); -} - async function testConfig(apiConfig) { assert.strictEqual(typeof apiConfig, 'object'); diff --git a/src/storage/noop.js b/src/storage/noop.js index dd7f043dd..8afbb7b1f 100644 --- a/src/storage/noop.js +++ b/src/storage/noop.js @@ -15,8 +15,6 @@ exports = module.exports = { remove, removeDir, - remount, - testConfig, removePrivateFields, injectPrivateFields @@ -106,10 +104,6 @@ async function removeDir(apiConfig, pathPrefix, progressCallback) { debug(`removeDir: ${pathPrefix}`); } -async function remount(apiConfig) { - assert.strictEqual(typeof apiConfig, 'object'); -} - async function testConfig(apiConfig) { assert.strictEqual(typeof apiConfig, 'object'); } diff --git a/src/storage/s3.js b/src/storage/s3.js index c926b3ae2..c04470901 100644 --- a/src/storage/s3.js +++ b/src/storage/s3.js @@ -15,8 +15,6 @@ exports = module.exports = { remove, removeDir, - remount, - testConfig, removePrivateFields, injectPrivateFields, @@ -532,10 +530,6 @@ async function removeDir(apiConfig, pathPrefix, progressCallback) { progressCallback({ message: `Removed ${total} files` }); } -async function remount(apiConfig) { - assert.strictEqual(typeof apiConfig, 'object'); -} - async function testConfig(apiConfig) { assert.strictEqual(typeof apiConfig, 'object');