From 5e49a33e8f745ab938eda465f88aeb32db3f7709 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 9 Apr 2024 13:00:27 +0200 Subject: [PATCH] backups: rootPath is needed only when testing storage --- src/backups.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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;