rename setupStorage to setupManagedStorage
This commit is contained in:
@@ -35,7 +35,7 @@ exports = module.exports = {
|
||||
setLimits,
|
||||
|
||||
getRootPath,
|
||||
setupStorage,
|
||||
setupManagedStorage,
|
||||
|
||||
remount,
|
||||
getMountStatus,
|
||||
@@ -448,7 +448,7 @@ function validateFormat(format) {
|
||||
return new BoxError(BoxError.BAD_FIELD, 'Invalid backup format');
|
||||
}
|
||||
|
||||
async function setupStorage(storageConfig, hostPath) {
|
||||
async function setupManagedStorage(storageConfig, hostPath) {
|
||||
assert.strictEqual(typeof storageConfig, 'object');
|
||||
assert.strictEqual(typeof hostPath, 'string');
|
||||
|
||||
@@ -459,7 +459,7 @@ async function setupStorage(storageConfig, hostPath) {
|
||||
const error = mounts.validateMountOptions(storageConfig.provider, storageConfig.mountOptions);
|
||||
if (error) throw error;
|
||||
|
||||
debug(`setupStorage: setting up mount at ${hostPath} with ${storageConfig.provider}`);
|
||||
debug(`setupManagedStorage: setting up mount at ${hostPath} with ${storageConfig.provider}`);
|
||||
|
||||
const newMount = {
|
||||
name: path.basename(hostPath),
|
||||
@@ -499,7 +499,7 @@ async function setStorage(storageConfig) {
|
||||
}
|
||||
|
||||
debug('setStorage: validating new storage configuration');
|
||||
const testMountObject = await setupStorage(storageConfig, '/mnt/backup-storage-validation'); // this validates mountOptions
|
||||
const testMountObject = await setupManagedStorage(storageConfig, '/mnt/backup-storage-validation'); // this validates mountOptions
|
||||
const testStorageError = await testStorage(Object.assign({ mountPath: '/mnt/backup-storage-validation' }, storageConfig)); // this validates provider and it's api options. requires mountPath
|
||||
if (testMountObject) await mounts.removeMount(testMountObject);
|
||||
if (testStorageError) throw testStorageError;
|
||||
@@ -508,7 +508,7 @@ async function setStorage(storageConfig) {
|
||||
if (mounts.isManagedProvider(oldConfig.provider)) await safe(mounts.removeMount(managedBackupMountObject(oldConfig)));
|
||||
|
||||
debug('setStorage: setting up new storage configuration');
|
||||
await setupStorage(storageConfig, paths.MANAGED_BACKUP_MOUNT_DIR);
|
||||
await setupManagedStorage(storageConfig, paths.MANAGED_BACKUP_MOUNT_DIR);
|
||||
|
||||
debug('setStorage: clearing backup cache');
|
||||
cleanupCacheFilesSync();
|
||||
|
||||
Reference in New Issue
Block a user