Skip to content

Commit

Permalink
fixup! feat(xo-server/host): implement smartctl api call
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuRA committed Sep 28, 2023
1 parent 61b5cae commit 7d4ed67
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/xo-server/src/xapi/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1442,8 +1442,10 @@ export default class Xapi extends XapiBase {
async getSmartctlInformation(hostId, deviceNames) {
try {
const informations =
(await this.call('host.call_plugin', this.getObject(hostId).$ref, 'smartctl.py', 'information', {})) !== 'false'
if (informations === false || deviceNames === undefined) {
JSON.parse(
await this.call('host.call_plugin', this.getObject(hostId).$ref, 'smartctl.py', 'information', {})
) !== 'false'
if (deviceNames === undefined) {
return informations
}
return pick(informations, deviceNames)
Expand Down

0 comments on commit 7d4ed67

Please sign in to comment.