feat(xo-web): prevent XO from checking time consistency of halted hosts

This commit is contained in:
Pierre Donias 2020-07-07 10:18:25 +02:00
parent fe7901ca7f
commit 59ca6c6708
5 changed files with 12 additions and 7 deletions

View File

@ -9,6 +9,7 @@
- [Backup] Better resolution of the "last run log" quick access (PR [#5141](https://github.com/vatesfr/xen-orchestra/pull/5141))
- [Patches] Don't check patches on halted XCP-ng hosts (PR [#5140](https://github.com/vatesfr/xen-orchestra/pull/5140))
- [XO] Don't check time consistency on halted hosts (PR [#5140](https://github.com/vatesfr/xen-orchestra/pull/5140))
### Bug fixes

View File

@ -10,8 +10,8 @@ import { isHostTimeConsistentWithXoaTime } from 'xo'
const InconsistentHostTimeWarning = decorate([
provideState({
computed: {
isHostTimeConsistentWithXoaTime: (_, { hostId }) =>
isHostTimeConsistentWithXoaTime(hostId),
isHostTimeConsistentWithXoaTime: (_, { host }) =>
isHostTimeConsistentWithXoaTime(host),
},
}),
injectState,
@ -24,7 +24,7 @@ const InconsistentHostTimeWarning = decorate([
])
InconsistentHostTimeWarning.propTypes = {
hostId: PropTypes.string.isRequired,
host: PropTypes.object.isRequired,
}
export { InconsistentHostTimeWarning as default }

View File

@ -850,8 +850,12 @@ export const emergencyShutdownHosts = hosts => {
)
}
export const isHostTimeConsistentWithXoaTime = host =>
_call('host.isHostServerTimeConsistent', { host: resolveId(host) })
export const isHostTimeConsistentWithXoaTime = host => {
if (host.power_state !== 'Running') {
return true
}
return _call('host.isHostServerTimeConsistent', { host: resolveId(host) })
}
export const isHyperThreadingEnabledHost = host =>
_call('host.isHyperThreadingEnabled', {

View File

@ -133,7 +133,7 @@ export default class HostItem extends Component {
</Tooltip>
)}
&nbsp;
<InconsistentHostTimeWarning hostId={host.id} />
<InconsistentHostTimeWarning host={host} />
&nbsp;
{hasLicenseRestrictions(host) && <LicenseWarning />}
</EllipsisContainer>

View File

@ -260,7 +260,7 @@ export default class Host extends Component {
</Tooltip>
)}
&nbsp;
<InconsistentHostTimeWarning hostId={host.id} />
<InconsistentHostTimeWarning host={host} />
</h2>
<Copiable tagName='pre' className='text-muted mb-0'>
{host.uuid}