Skip to content

Commit 370aca0

Browse files
committed
Refactor
1 parent a56ebbb commit 370aca0

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,13 +1414,13 @@ private void configureAgentHooks(final Map<String, Object> params) {
14141414
s_logger.debug("agent.hooks.libvirt_vm_on_stop.method is " + _agentHooksVmOnStopMethod);
14151415
}
14161416

1417-
public boolean isUefiPropertiesFileSet() {
1418-
return PropertiesUtil.findConfigFile("uefi.properties") != null;
1417+
public boolean isUefiPropertiesFileLoaded() {
1418+
return _uefiProperties != null && _uefiProperties.getProperty("guest.loader.legacy") != null;
14191419
}
14201420

14211421
private void loadUefiProperties() throws FileNotFoundException {
14221422

1423-
if (_uefiProperties != null && _uefiProperties.getProperty("guest.loader.legacy") != null) {
1423+
if (isUefiPropertiesFileLoaded()) {
14241424
return;
14251425
}
14261426
final File file = PropertiesUtil.findConfigFile("uefi.properties");

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtReadyCommandWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public final class LibvirtReadyCommandWrapper extends CommandWrapper<ReadyComman
4242
public Answer execute(final ReadyCommand command, final LibvirtComputingResource libvirtComputingResource) {
4343
Map<String, String> hostDetails = new HashMap<String, String>();
4444

45-
if (hostSupportsUefi() && libvirtComputingResource.isUefiPropertiesFileSet()) {
45+
if (hostSupportsUefi() && libvirtComputingResource.isUefiPropertiesFileLoaded()) {
4646
hostDetails.put(Host.HOST_UEFI_ENABLE, Boolean.TRUE.toString());
4747
}
4848

0 commit comments

Comments
 (0)