chore: format with Prettier

This commit is contained in:
Julien Fontanet
2021-12-23 12:06:11 +01:00
parent 24c8370daa
commit 7b73bb9df0
3 changed files with 32 additions and 27 deletions

View File

@@ -4,7 +4,6 @@ about: Create a report to help us improve
title: ''
labels: 'status: triaging :triangular_flag_on_post:, type: bug :bug:'
assignees: ''
---
**Describe the bug**
@@ -12,6 +11,7 @@ A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
@@ -24,10 +24,11 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- Node: [e.g. 16.12.1]
- xo-server: [e.g. 5.82.3]
- xo-web: [e.g. 5.87.0]
- hypervisor: [e.g. XCP-ng 8.2.0]
- Node: [e.g. 16.12.1]
- xo-server: [e.g. 5.82.3]
- xo-web: [e.g. 5.87.0]
- hypervisor: [e.g. XCP-ng 8.2.0]
**Additional context**
Add any other context about the problem here.

View File

@@ -14,7 +14,7 @@ import { createLogger } from '@xen-orchestra/log'
const { debug, warn } = createLogger('xo:proxy:api')
const ndJsonStream = asyncIteratorToStream(async function*(responseId, iterable) {
const ndJsonStream = asyncIteratorToStream(async function* (responseId, iterable) {
try {
let cursor, iterator
try {
@@ -52,7 +52,7 @@ export default class Api {
ctx.req.setTimeout(0)
const profile = await app.authentication.findProfile({
authenticationToken: ctx.cookies.get('authenticationToken')
authenticationToken: ctx.cookies.get('authenticationToken'),
})
if (profile === undefined) {
ctx.status = 401
@@ -123,7 +123,7 @@ export default class Api {
this.addMethods({
system: {
getMethodsInfo: [
function*() {
function* () {
const methods = this._methods
for (const name in methods) {
const { description, params = {} } = methods[name]
@@ -131,25 +131,25 @@ export default class Api {
}
}.bind(this),
{
description: 'returns the signatures of all available API methods'
}
description: 'returns the signatures of all available API methods',
},
],
getServerVersion: [
() => appVersion,
{
description: 'returns the version of xo-server'
}
description: 'returns the version of xo-server',
},
],
listMethods: [
function*() {
function* () {
const methods = this._methods
for (const name in methods) {
yield name
}
}.bind(this),
{
description: 'returns the name of all available API methods'
}
description: 'returns the name of all available API methods',
},
],
methodSignature: [
({ method: name }) => {
@@ -164,14 +164,14 @@ export default class Api {
{
description: 'returns the signature of an API method',
params: {
method: { type: 'string' }
}
}
]
method: { type: 'string' },
},
},
],
},
test: {
range: [
function*({ start = 0, stop, step }) {
function* ({ start = 0, stop, step }) {
if (step === undefined) {
step = start > stop ? -1 : 1
}
@@ -189,11 +189,11 @@ export default class Api {
params: {
start: { optional: true, type: 'number' },
step: { optional: true, type: 'number' },
stop: { type: 'number' }
}
}
]
}
stop: { type: 'number' },
},
},
],
},
})
}
@@ -220,7 +220,7 @@ export default class Api {
return required
}),
type: 'object'
type: 'object',
})
const m = params => {

View File

@@ -61,7 +61,11 @@ test('VMDK to VHD can convert a random data file with VMDKDirectParser', async (
})
const result = await readVmdkGrainTable(createFileAccessor(vmdkFileName))
const pipe = (
await vmdkToVhd(createReadStream(vmdkFileName), bufferToArray(result.grainLogicalAddressList), bufferToArray(result.grainFileOffsetList))
await vmdkToVhd(
createReadStream(vmdkFileName),
bufferToArray(result.grainLogicalAddressList),
bufferToArray(result.grainFileOffsetList)
)
).pipe(createWriteStream(vhdFileName))
await fromEvent(pipe, 'finish')
await execa('vhd-util', ['check', '-p', '-b', '-t', '-n', vhdFileName])