mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Set UefiCapabilty for all hypervisors in hostresponse (#6140)
This commit is contained in:
parent
38a0ded053
commit
6125886f3d
@ -533,13 +533,6 @@ public class HostResponse extends BaseResponseWithAnnotations {
|
|||||||
detailsCopy.remove("username");
|
detailsCopy.remove("username");
|
||||||
detailsCopy.remove("password");
|
detailsCopy.remove("password");
|
||||||
|
|
||||||
if (detailsCopy.containsKey(Host.HOST_UEFI_ENABLE)) {
|
|
||||||
this.setUefiCapabilty(Boolean.parseBoolean((String) detailsCopy.get(Host.HOST_UEFI_ENABLE)));
|
|
||||||
detailsCopy.remove(Host.HOST_UEFI_ENABLE);
|
|
||||||
} else {
|
|
||||||
this.setUefiCapabilty(new Boolean(false)); // in case of existing host which is not scanned for UEFI capability
|
|
||||||
}
|
|
||||||
|
|
||||||
this.details = detailsCopy;
|
this.details = detailsCopy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import java.util.Date;
|
|||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@ -230,10 +231,18 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, String> hostDetails = hostDetailsDao.findDetails(host.getId());
|
||||||
|
if (hostDetails != null) {
|
||||||
|
if (hostDetails.containsKey(Host.HOST_UEFI_ENABLE)) {
|
||||||
|
hostResponse.setUefiCapabilty(Boolean.parseBoolean((String) hostDetails.get(Host.HOST_UEFI_ENABLE)));
|
||||||
|
} else {
|
||||||
|
hostResponse.setUefiCapabilty(new Boolean(false));
|
||||||
|
}
|
||||||
|
}
|
||||||
if (details.contains(HostDetails.all) && host.getHypervisorType() == Hypervisor.HypervisorType.KVM) {
|
if (details.contains(HostDetails.all) && host.getHypervisorType() == Hypervisor.HypervisorType.KVM) {
|
||||||
//only kvm has the requirement to return host details
|
//only kvm has the requirement to return host details
|
||||||
try {
|
try {
|
||||||
hostResponse.setDetails(hostDetailsDao.findDetails(host.getId()));
|
hostResponse.setDetails(hostDetails);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
s_logger.debug("failed to get host details", e);
|
s_logger.debug("failed to get host details", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user