backups: rootPath is needed only when testing storage

This commit is contained in:
Girish Ramakrishnan
2024-04-09 13:00:27 +02:00
parent 5fb7d53018
commit 5e49a33e8f
+2 -3
View File
@@ -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;