Skip to content

Commit 18cfe56

Browse files
committed
Rename ambiguous global setting: enable.kvm.host.auto.enable.disable
1 parent 47f6019 commit 18cfe56

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

engine/components-api/src/main/java/com/cloud/agent/AgentManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
public interface AgentManager {
4040
static final ConfigKey<Integer> Wait = new ConfigKey<Integer>("Advanced", Integer.class, "wait", "1800", "Time in seconds to wait for control commands to return",
4141
true);
42-
ConfigKey<Boolean> EnableKVMAutoEnableDisable = new ConfigKey<>(Boolean.class,
43-
"enable.kvm.host.auto.enable.disable",
42+
ConfigKey<Boolean> EnableKVMAutoEnable = new ConfigKey<>(Boolean.class,
43+
"enable.kvm.host.auto.enable",
4444
"Advanced",
4545
"false",
4646
"(KVM only) Enable Auto Disable/Enable KVM hosts in the cluster " +

engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,9 +1293,9 @@ private void processHostHealthCheckResult(Boolean hostHealthCheckResult, long ho
12931293
s_logger.error(String.format("Unable to find host with ID: %s", hostId));
12941294
return;
12951295
}
1296-
if (!BooleanUtils.toBoolean(EnableKVMAutoEnableDisable.valueIn(host.getClusterId()))) {
1296+
if (!BooleanUtils.toBoolean(EnableKVMAutoEnable.valueIn(host.getClusterId()))) {
12971297
s_logger.debug(String.format("%s is disabled for the cluster %s, cannot process the health check result " +
1298-
"received for the host %s", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host.getName()));
1298+
"received for the host %s", EnableKVMAutoEnable.key(), host.getClusterId(), host.getName()));
12991299
return;
13001300
}
13011301

@@ -1838,7 +1838,7 @@ public String getConfigComponentName() {
18381838
@Override
18391839
public ConfigKey<?>[] getConfigKeys() {
18401840
return new ConfigKey<?>[] { CheckTxnBeforeSending, Workers, Port, Wait, AlertWait, DirectAgentLoadSize,
1841-
DirectAgentPoolSize, DirectAgentThreadCap, EnableKVMAutoEnableDisable, ReadyCommandWait };
1841+
DirectAgentPoolSize, DirectAgentThreadCap, EnableKVMAutoEnable, ReadyCommandWait };
18421842
}
18431843

18441844
protected class SetHostParamsListener implements Listener {

server/src/main/java/com/cloud/resource/ResourceManagerImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ private void handleAutoEnableDisableKVMHost(boolean autoEnableDisableKVMSetting,
18341834
Boolean.parseBoolean(hostDetail.getValue()) && resourceEvent == ResourceState.Event.Disable) {
18351835
s_logger.info(String.format("The setting %s is enabled but the host %s is manually set into %s state," +
18361836
"ignoring future auto enabling of the host based on health check results",
1837-
AgentManager.EnableKVMAutoEnableDisable.key(), host.getName(), resourceEvent));
1837+
AgentManager.EnableKVMAutoEnable.key(), host.getName(), resourceEvent));
18381838
hostDetail.setValue(Boolean.FALSE.toString());
18391839
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
18401840
} else if (hostDetail == null) {
@@ -1846,7 +1846,7 @@ private void handleAutoEnableDisableKVMHost(boolean autoEnableDisableKVMSetting,
18461846
}
18471847
private boolean updateHostAllocationState(HostVO host, String allocationState,
18481848
boolean isUpdateFromHostHealthCheck) throws NoTransitionException {
1849-
boolean autoEnableDisableKVMSetting = AgentManager.EnableKVMAutoEnableDisable.valueIn(host.getClusterId()) &&
1849+
boolean autoEnableDisableKVMSetting = AgentManager.EnableKVMAutoEnable.valueIn(host.getClusterId()) &&
18501850
host.getHypervisorType() == HypervisorType.KVM;
18511851
ResourceState.Event resourceEvent = getResourceEventFromAllocationStateString(allocationState);
18521852
DetailVO hostDetail = _hostDetailsDao.findDetail(host.getId(), ApiConstants.AUTO_ENABLE_KVM_HOST);
@@ -1860,7 +1860,7 @@ private boolean updateHostAllocationState(HostVO host, String allocationState,
18601860
if (isAutoEnableAttemptForADisabledHost(autoEnableDisableKVMSetting, isUpdateFromHostHealthCheck, hostDetail, resourceEvent)) {
18611861
s_logger.debug(String.format("The setting '%s' is enabled and the health check succeeds on the host, " +
18621862
"but the host has been manually disabled previously, ignoring auto enabling",
1863-
AgentManager.EnableKVMAutoEnableDisable.key()));
1863+
AgentManager.EnableKVMAutoEnable.key()));
18641864
return false;
18651865
}
18661866

@@ -1974,7 +1974,7 @@ private void sendAlertAndAnnotationForAutoEnableDisableKVMHostFeature(HostVO hos
19741974
boolean isUpdateFromHostHealthCheck,
19751975
boolean isUpdateHostAllocation, String annotation) {
19761976
boolean isAutoEnableDisableKVMSettingEnabled = host.getHypervisorType() == HypervisorType.KVM &&
1977-
AgentManager.EnableKVMAutoEnableDisable.valueIn(host.getClusterId());
1977+
AgentManager.EnableKVMAutoEnable.valueIn(host.getClusterId());
19781978
if (!isAutoEnableDisableKVMSettingEnabled) {
19791979
if (StringUtils.isNotBlank(annotation)) {
19801980
annotationService.addAnnotation(annotation, AnnotationService.EntityType.HOST, host.getUuid(), true);
@@ -1998,7 +1998,7 @@ private void sendAlertAndAnnotationForAutoEnableDisableKVMHostFeature(HostVO hos
19981998
host.getPodId(), msg, msg);
19991999
} else {
20002000
msg += String.format("is %s despite the setting '%s' is enabled for the cluster %s",
2001-
isEventEnable ? "enabled" : "disabled", AgentManager.EnableKVMAutoEnableDisable.key(),
2001+
isEventEnable ? "enabled" : "disabled", AgentManager.EnableKVMAutoEnable.key(),
20022002
host.getClusterId());
20032003
if (StringUtils.isNotBlank(annotation)) {
20042004
msg += String.format(", reason: %s", annotation);

0 commit comments

Comments
 (0)