DaanHoogland commented on code in PR #10603:
URL: https://github.com/apache/cloudstack/pull/10603#discussion_r2009899705
##########
plugins/host-allocators/random/src/main/java/com/cloud/agent/manager/allocator/impl/RandomAllocator.java:
##########
@@ -94,15 +94,15 @@ private List<Host> findSuitableHosts(VirtualMachineProfile
vmProfile, Deployment
return suitableHosts;
}
String offeringHostTag = offering.getHostTag();
+
VMTemplateVO template = (VMTemplateVO)vmProfile.getTemplate();
String templateTag = template.getTemplateTag();
String hostTag = null;
if (ObjectUtils.anyNull(offeringHostTag, templateTag)) {
hostTag = offeringHostTag;
- hostTag = hostTag == null ? templateTag : String.format("%s, %s",
hostTag, templateTag);
- logger.debug(String.format("Looking for hosts in dc [%s], pod
[%s], cluster [%s] and complying with host tag(s): [%s]", dcId, podId,
clusterId, hostTag));
+ logger.debug("Looking for hosts in dc [{}], pod [{}], cluster [{}]
and complying with host tag(s): [{}]", dcId, podId, clusterId, hostTag);
Review Comment:
shouldn't these be allNotNull ?
##########
server/src/main/java/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java:
##########
@@ -130,8 +129,8 @@ public List<Host> allocateTo(VirtualMachineProfile
vmProfile, DeploymentPlan pla
// FirstFitAllocator should be used for user VMs only since it
won't care whether the host is capable of routing or not
return new ArrayList<>();
}
-
- logger.debug("Looking for hosts in zone [{}], pod [{}], cluster [{}]",
dcId, podId, clusterId);
+ String paramAsStringToLog = String.format("zone [%s], pod [%s],
cluster [%s]", dcId, podId, clusterId);
+ logger.debug("Looking for hosts in {}", paramAsStringToLog);
Review Comment:
why can't the logger do the formatting?
--
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]