diff --git a/src/backups.js b/src/backups.js index 8ba1dd4a4..a64049cc6 100644 --- a/src/backups.js +++ b/src/backups.js @@ -495,10 +495,9 @@ async function setStorage(storageConfig) { } debug('setStorage: validating new storage configuration'); + const testMountObject = await setupStorage(storageConfig, '/mnt/backup-storage-validation'); // this validates mountOptions const rootPath = getRootPath(storageConfig, '/mnt/backup-storage-validation'); - const testStorageConfig = Object.assign({ rootPath }, storageConfig); - const testMountObject = await setupStorage(testStorageConfig, '/mnt/backup-storage-validation'); - const testStorageError = await testStorage(testStorageConfig); + const testStorageError = await testStorage(Object.assign({ rootPath }, storageConfig)); // this validates provider and it's api options. requires rootPath if (testMountObject) await mounts.removeMount(testMountObject); if (testStorageError) throw testStorageError;