backups: rootPath is needed only when testing storage
This commit is contained in:
+2
-3
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user