Skip to content

Commit 0977c5c

Browse files
committed
update as per inputs
1 parent d879560 commit 0977c5c

File tree

1 file changed

+4
-2
lines changed
  • plugins/host-allocators/random/src/main/java/com/cloud/agent/manager/allocator/impl

1 file changed

+4
-2
lines changed

plugins/host-allocators/random/src/main/java/com/cloud/agent/manager/allocator/impl/RandomAllocator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ private List<Host> findSuitableHosts(VirtualMachineProfile vmProfile, Deployment
9898
VMTemplateVO template = (VMTemplateVO)vmProfile.getTemplate();
9999
String templateTag = template.getTemplateTag();
100100
String hostTag = null;
101-
if (ObjectUtils.anyNull(offeringHostTag, templateTag)) {
102-
hostTag = offeringHostTag;
101+
if (ObjectUtils.anyNotNull(offeringHostTag, templateTag)) {
102+
hostTag = ObjectUtils.allNotNull(offeringHostTag, templateTag) ?
103+
String.format("%s, %s", offeringHostTag, templateTag) :
104+
ObjectUtils.firstNonNull(offeringHostTag, templateTag);
103105
logger.debug("Looking for hosts in dc [{}], pod [{}], cluster [{}] and complying with host tag(s): [{}]", dcId, podId, clusterId, hostTag);
104106
} else {
105107
logger.debug("Looking for hosts in dc: {} pod: {} cluster: {}", dcId , podId, clusterId);

0 commit comments

Comments
 (0)