Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ private void processHostHealthCheckResult(Boolean hostHealthCheckResult, long ho
}
if (!BooleanUtils.toBoolean(EnableKVMAutoEnableDisable.valueIn(host.getClusterId()))) {
logger.debug("{} is disabled for the cluster {}, cannot process the health check result " +
"received for the host {}", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host);
"received for the {}", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host);
Comment thread
Pearl1594 marked this conversation as resolved.
Outdated
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1840,9 +1840,9 @@ private void handleAutoEnableDisableKVMHost(boolean autoEnableDisableKVMSetting,
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
} else if (!isUpdateFromHostHealthCheck && hostDetail != null &&
Boolean.parseBoolean(hostDetail.getValue()) && resourceEvent == ResourceState.Event.Disable) {
logger.info(String.format("The setting %s is enabled but the host %s is manually set into %s state," +
logger.info("The setting {} is enabled but the {} is manually set into {} state," +
Comment thread
Pearl1594 marked this conversation as resolved.
Outdated
"ignoring future auto enabling of the host based on health check results",
AgentManager.EnableKVMAutoEnableDisable.key(), host.getName(), resourceEvent));
AgentManager.EnableKVMAutoEnableDisable.key(), host, resourceEvent);
hostDetail.setValue(Boolean.FALSE.toString());
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
} else if (hostDetail == null) {
Expand Down
12 changes: 6 additions & 6 deletions ui/src/views/infra/HostEnableDisable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
>
<a-alert type="warning">
<template #message>
<span v-html="$t('message.confirm.enable.host')" />
<span v-html="resourcestate === 'Disabled' ? $t('message.confirm.enable.host') : $t('message.confirm.disable.host') " />
</template>
</a-alert>
<div v-show="enableKVMAutoEnableDisableSetting" class="reason">
<div v-show="kvmAutoEnableDisableSetting" class="reason">
<a-form-item
class="form__item"
name="reason"
ref="reason"
:label="'The setting \'enable.kvm.host.auto.enable.disable\' is enabled, ' +
:label="'The Auto Enable/Disable KVM Hosts functionality is enabled, ' +
' can specify a reason for ' + (resourcestate === 'Enabled' ? 'disabling' : 'enabling') + ' this host'">
<a-textarea
v-model:value="form.reason"
Expand Down Expand Up @@ -69,7 +69,7 @@ export default {
return {
resourcestate: '',
allocationstate: '',
enableKVMAutoEnableDisableSetting: false
kvmAutoEnableDisableSetting: false
}
},
created () {
Expand All @@ -91,8 +91,8 @@ export default {
return
}
api('listConfigurations', { name: 'enable.kvm.host.auto.enable.disable', clusterid: this.resource.clusterid }).then(json => {
if (json.listconfigurationsresponse.configuration[0]) {
this.enableKVMAutoEnableDisableSetting = json.listconfigurationsresponse.configuration[0].value
if (json.listconfigurationsresponse.configuration?.[0]) {
this.kvmAutoEnableDisableSetting = json?.listconfigurationsresponse?.configuration?.[0]?.value || false
}
})
},
Expand Down