Fixup some refactoring issues in mounting ext4
This commit is contained in:
@@ -311,7 +311,7 @@ async function teardown(config) {
|
||||
if (!mounts.isManagedProvider(config._provider)) return;
|
||||
|
||||
const mountPath = path.join(paths.MANAGED_BACKUP_MOUNT_DIR, config.id);
|
||||
await safe(mounts.removeMount(mountPath), { debug }); // ignore error
|
||||
await safe(mounts.removeMount({ hostPath: mountPath, mountType: config._provider, mountOptions: config.mountOptions }), { debug }); // ignore error
|
||||
}
|
||||
|
||||
async function verifyConfig({ id, provider, config }) {
|
||||
@@ -358,7 +358,7 @@ async function verifyConfig({ id, provider, config }) {
|
||||
}
|
||||
|
||||
const tmp = _.pick(config, ['noHardlinks', 'chown', 'preserveAttributes', 'backupDir', 'prefix', 'mountOptions', 'mountPoint']);
|
||||
const newConfig = { _provider: provider, _managedMountPath: managedMountPath, ...tmp };
|
||||
const newConfig = { _provider: provider, _managedMountPath: managedMountPath, id, ...tmp };
|
||||
const fullPath = getRootPath(newConfig);
|
||||
|
||||
if (!safe.fs.mkdirSync(path.join(fullPath, 'snapshot'), { recursive: true }) && safe.error.code !== 'EEXIST') {
|
||||
@@ -374,7 +374,7 @@ async function verifyConfig({ id, provider, config }) {
|
||||
throw new BoxError(BoxError.BAD_FIELD, `Unable to remove test file as 'yellowtent' user in ${fullPath}: ${safe.error.message}. Check dir/mount permissions`);
|
||||
}
|
||||
|
||||
if (mounts.isManagedProvider(provider)) await mounts.removeMount(`${managedMountPath}-validation`);
|
||||
if (mounts.isManagedProvider(provider)) await mounts.removeMount({ hostPath: `${managedMountPath}-validation`, mountType: provider, mountOptions: config.mountOptions });
|
||||
|
||||
return newConfig;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user