Skip to content

Commit e77240f

Browse files
committed
fix(xo-web): avoid unrelevant isPubKeyTooShort calls
1 parent 5fd2c19 commit e77240f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/xo-web/src/common/xo/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,13 @@ export const installCertificateOnHost = (id, props) => _call('host.installCertif
14181418

14191419
export const setControlDomainMemory = (id, memory) => _call('host.setControlDomainMemory', { id, memory })
14201420

1421-
export const isPubKeyTooShort = id => _call('host.isPubKeyTooShort', { id })
1421+
export const isPubKeyTooShort = host => {
1422+
// this check is only relevant for old hosts, and cannot be done on offline hosts
1423+
if (host.productBrand !== 'XCP-ng' || semver.satisfies(host.version, '>=8.3.0') || host.power_state === 'Halted') {
1424+
return Promise.resolve(false)
1425+
}
1426+
return _call('host.isPubKeyTooShort', { id: host.id })
1427+
}
14221428

14231429
// for XCP-ng now
14241430
export const installAllPatchesOnHost = ({ host }) =>

packages/xo-web/src/xo-app/home/host-item.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default class HostItem extends Component {
6464
}
6565

6666
componentWillMount() {
67-
isPubKeyTooShort(this.props.item.id).then(value =>
67+
isPubKeyTooShort(this.props.item).then(value =>
6868
this.setState({
6969
isPubKeyTooShort: value,
7070
})

0 commit comments

Comments
 (0)