fix(xapi/VIF_create): fetch power_state and MTU in parallel

This commit is contained in:
Julien Fontanet 2024-02-14 11:46:43 +01:00
parent 39c10a7197
commit f23fd69e7e

View File

@ -35,9 +35,9 @@ export default class Vif {
const [powerState, ...rest] = await Promise.all([
this.getField('VM', VM, 'power_state'),
MTU ?? (await this.getField('network', network, 'MTU')),
MTU ?? this.getField('network', network, 'MTU'),
])
;[device, MTU] = rest
;[MTU] = rest
const vifRef = await this.call('VIF.create', {
currently_attached: powerState === 'Suspended' ? currently_attached : undefined,