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') {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
getRootPath,
|
||||
getBackupRootPath,
|
||||
checkBackupPreconditions,
|
||||
|
||||
upload,
|
||||
@@ -66,7 +66,7 @@ function getBucket(apiConfig) {
|
||||
}
|
||||
|
||||
// storage api
|
||||
function getRootPath(apiConfig) {
|
||||
function getBackupRootPath(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
|
||||
return apiConfig.prefix;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// for the other API calls we leave it to the backend to retry. this allows
|
||||
// them to tune the concurrency based on failures/rate limits accordingly
|
||||
exports = module.exports = {
|
||||
getRootPath,
|
||||
getBackupRootPath,
|
||||
checkBackupPreconditions,
|
||||
|
||||
upload,
|
||||
@@ -47,7 +47,7 @@ function injectPrivateFields(newConfig, currentConfig) {
|
||||
// in-place injection of tokens and api keys which came in with constants.SECRET_PLACEHOLDER
|
||||
}
|
||||
|
||||
function getRootPath(apiConfig) {
|
||||
function getBackupRootPath(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
|
||||
// Result: path at the backup storage
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
getRootPath,
|
||||
getBackupRootPath,
|
||||
checkBackupPreconditions,
|
||||
|
||||
upload,
|
||||
@@ -26,7 +26,7 @@ const assert = require('assert'),
|
||||
DataLayout = require('../datalayout.js'),
|
||||
debug = require('debug')('box:storage/noop');
|
||||
|
||||
function getRootPath(apiConfig) {
|
||||
function getBackupRootPath(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
getRootPath,
|
||||
getBackupRootPath,
|
||||
checkBackupPreconditions,
|
||||
|
||||
upload,
|
||||
@@ -92,7 +92,7 @@ function getS3Config(apiConfig) {
|
||||
}
|
||||
|
||||
// storage api
|
||||
function getRootPath(apiConfig) {
|
||||
function getBackupRootPath(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
|
||||
return apiConfig.prefix;
|
||||
|
||||
Reference in New Issue
Block a user