mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-09-10 22:14:48 -05:00
fix(CI): do not log "ENOENT" when unlink fails after check (#10102)
* fix(CI): do not log "ENOENT" when unlink fails after check * fix: await for mkdirp before continuing
This commit is contained in:
@@ -32,7 +32,9 @@ async function checkFile(vhdName) {
|
||||
try {
|
||||
await fsPromise.unlink(target)
|
||||
} catch (err) {
|
||||
console.warn(err)
|
||||
if (err.code !== 'ENOENT') {
|
||||
console.warn(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,7 +73,7 @@ exports.recoverRawContent = async function recoverRawContent(vhdName, rawName, o
|
||||
|
||||
// @ todo how can I call vhd-cli copy from here
|
||||
async function convertToVhdDirectory(rawFileName, vhdFileName, path) {
|
||||
fs.mkdirp(path)
|
||||
await fs.mkdirp(path)
|
||||
|
||||
const srcVhd = await fs.open(vhdFileName, 'r')
|
||||
|
||||
@@ -108,7 +110,7 @@ async function convertToVhdDirectory(rawFileName, vhdFileName, path) {
|
||||
exports.convertToVhdDirectory = convertToVhdDirectory
|
||||
|
||||
exports.createRandomVhdDirectory = async function createRandomVhdDirectory(path, sizeMB) {
|
||||
fs.mkdirp(path)
|
||||
await fs.mkdirp(path)
|
||||
const rawFileName = `${path}/temp.raw`
|
||||
await createRandomFile(rawFileName, sizeMB)
|
||||
const vhdFileName = `${path}/temp.vhd`
|
||||
|
||||
Reference in New Issue
Block a user