Skip to content

Commit f7bc13a

Browse files
committed
server: code optimization for PR #4001
1 parent 3624cde commit f7bc13a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

plugins/affinity-group-processors/explicit-dedication/src/main/java/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,8 @@ public void process(VirtualMachineProfile vmProfile, DeploymentPlan plan, Exclud
9595
List<DedicatedResourceVO> dedicatedHosts = _dedicatedDao.listAll();
9696
for (DedicatedResourceVO host : dedicatedHosts) {
9797
// Hosts dedicated to different domain/account are not suitable for migration
98-
if (host.getAccountId() != null && vm.getAccountId() != host.getAccountId()) {
99-
avoid.addHost(host.getHostId());
100-
}
101-
if (host.getDomainId() != null && vm.getDomainId() != host.getDomainId()) {
98+
if ((host.getAccountId() != null && vm.getAccountId() != host.getAccountId()) ||
99+
(host.getDomainId() != null && vm.getDomainId() != host.getDomainId())) {
102100
avoid.addHost(host.getHostId());
103101
}
104102
}

0 commit comments

Comments
 (0)