Skip to content

Commit

Permalink
last last changes?
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaFrncJrg committed Nov 25, 2024
1 parent ef09a97 commit f3e09f9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/xo-server/src/xapi/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1550,19 +1550,16 @@ export default class Xapi extends XapiBase {
servers = cache.get('servers')
}

const serverData = servers?.[hostServerName]
const serverData = servers[hostServerName]

if (serverData === undefined) {
return
}

const { 'BIOS-Version': latestBiosVersion, 'BIOS-link': biosLink } = serverData

function convertToSemver(version) {
return version.split('.').map(Number).join('.')
}

const isUpToDate = semver.eq(convertToSemver(currentBiosVersion), convertToSemver(latestBiosVersion))
// Compare versions loosely to handle non-standard formats
const isUpToDate = semver.eq(currentBiosVersion, latestBiosVersion, { loose: true })

return { currentBiosVersion, latestBiosVersion, biosLink, isUpToDate }
}
Expand Down

0 comments on commit f3e09f9

Please sign in to comment.