Skip to content

Commit

Permalink
fix(xo-server): use callAsync to install XCP-ng updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-f committed Apr 30, 2024
1 parent 5079493 commit 6870e06
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Pool] Fix `Headers Timeout Error` when installing patches on XCP-ng

### Packages to release

> When modifying a package, add it here with its release type.
Expand All @@ -27,4 +29,6 @@
<!--packages-start-->

- xo-server patch

<!--packages-end-->
2 changes: 2 additions & 0 deletions packages/xo-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"@vates/parse-duration": "^0.1.1",
"@vates/predicates": "^1.1.0",
"@vates/read-chunk": "^1.2.0",
"@vates/xml": "^2.0.0",
"@vates/xml-rpc": "^1.0.0",
"@xen-orchestra/async-map": "^0.1.2",
"@xen-orchestra/backups": "^0.48.0",
"@xen-orchestra/cron": "^1.0.6",
Expand Down
5 changes: 4 additions & 1 deletion packages/xo-server/src/xapi/mixins/patching.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { createLogger } from '@xen-orchestra/log'
import { decorateObject } from '@vates/decorate-with'
import { defer as deferrable } from 'golike-defer'
import { extractOpaqueRef } from '@xen-orchestra/xapi'
import { parseXml as parseXmlTree } from '@vates/xml/parse'
import { Task } from '@xen-orchestra/mixins/Tasks.mjs'
import { xmlRpcParser } from '@vates/xml-rpc/parser'

import ensureArray from '../../_ensureArray.mjs'
import { debounceWithKey } from '../../_pDebounceWithKey.mjs'
Expand Down Expand Up @@ -309,7 +311,8 @@ const methods = {
hosts = hosts.sort(({ $ref }) => ($ref === this.pool.master ? -1 : 1))
for (const host of hosts) {
// With throw in case of error with XCP-ng>=8.2.1
const result = JSON.parse(await this.call('host.call_plugin', host.$ref, 'updater.py', 'update', {}))
const xml = await this.callAsync('host.call_plugin', host.$ref, 'updater.py', 'update', {})
const result = JSON.parse(xmlRpcParser.parse_value(parseXmlTree(xml)))

// Defined and different than 0 in case of error with XCP-ng<8.2.1
const { exit } = result
Expand Down

0 comments on commit 6870e06

Please sign in to comment.