nvazquez commented on a change in pull request #6104:
URL: https://github.com/apache/cloudstack/pull/6104#discussion_r835493076
##########
File path:
server/src/main/java/org/apache/cloudstack/direct/download/DirectDownloadManagerImpl.java
##########
@@ -475,48 +486,55 @@ public boolean uploadCertificateToHosts(String
certificateCer, String alias, Str
certificateVO = directDownloadCertificateDao.findByAlias(alias,
hypervisorType, zoneId);
if (certificateVO == null) {
s_logger.info("Certificate must be uploaded on zone " +
zoneId);
- return false;
+ return new ArrayList<>();
}
}
s_logger.info("Attempting to upload certificate: " + alias + " to " +
hosts.size() + " hosts on zone " + zoneId);
- int hostCount = 0;
+ int success = 0;
+ int failed = 0;
+ List<HostCertificateStatus> results = new ArrayList<>();
if (CollectionUtils.isNotEmpty(hosts)) {
for (HostVO host : hosts) {
- if (!uploadCertificate(certificateVO.getId(), host.getId())) {
- String msg = "Could not upload certificate " + alias + "
on host: " + host.getName() + " (" + host.getUuid() + ")";
+ if (host == null) {
+ continue;
+ }
+ HostCertificateStatus hostStatus;
+ Pair<Boolean, String> result =
provisionCertificate(certificateVO.getId(), host.getId());
+ if (!result.first()) {
+ String msg = "Could not upload certificate " + alias + "
on host: " + host.getName() + " (" + host.getUuid() + "): " + result.second();
s_logger.error(msg);
- throw new CloudRuntimeException(msg);
+ failed++;
Review comment:
Yes, there is a new API for provisioning certificate to a host
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]