rename getRootPath to getBackupRootPath
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
getRootPath,
|
||||
getBackupRootPath,
|
||||
checkBackupPreconditions,
|
||||
|
||||
upload,
|
||||
@@ -45,7 +45,7 @@ const assert = require('assert'),
|
||||
shell = require('../shell.js');
|
||||
|
||||
// storage api
|
||||
function getRootPath(apiConfig) {
|
||||
function getBackupRootPath(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
|
||||
switch (apiConfig.provider) {
|
||||
@@ -77,7 +77,7 @@ async function checkBackupPreconditions(apiConfig, dataLayout) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
assert(dataLayout instanceof DataLayout, 'dataLayout must be a DataLayout');
|
||||
|
||||
const [error, rootPath] = await safe(df.file(getRootPath(apiConfig)));
|
||||
const [error, rootPath] = await safe(df.file(getBackupRootPath(apiConfig)));
|
||||
if (error) throw new BoxError(BoxError.FS_ERROR, `Error when checking for disk space: ${error.message}`);
|
||||
|
||||
// Check filesystem is mounted so we don't write into the actual folder on disk
|
||||
@@ -308,7 +308,7 @@ async function testConfig(apiConfig) {
|
||||
if (!safe.child_process.execSync(`mountpoint -q -- ${apiConfig.mountPoint}`)) throw new BoxError(BoxError.BAD_FIELD, `${apiConfig.mountPoint} is not mounted`);
|
||||
}
|
||||
|
||||
const basePath = getRootPath(apiConfig);
|
||||
const basePath = getBackupRootPath(apiConfig);
|
||||
const field = apiConfig.provider === PROVIDER_FILESYSTEM ? 'backupFolder' : 'mountPoint';
|
||||
|
||||
if (!safe.fs.mkdirSync(path.join(basePath, 'snapshot'), { recursive: true }) && safe.error.code !== 'EEXIST') {
|
||||
|
||||
Reference in New Issue
Block a user