listPublicIpAddresses: when do join with nics table, count only non-removed nics

This commit is contained in:
Alena Prokharchyk 2012-07-24 11:55:02 -07:00
parent 7b05172473
commit f68a1a7d44
1 changed files with 0 additions and 17 deletions

View File

@ -1785,19 +1785,6 @@ public class ManagementServerImpl implements ManagementServer {
vlanType = VlanType.VirtualNetwork;
}
// don't show SSVM/CPVM ips
boolean omitSystemVmIps = false;
if (vlanType == VlanType.VirtualNetwork && (allocatedOnly) && vpcId == null) {
SearchBuilder<NicVO> nonSystemVmSearch = _nicDao.createSearchBuilder();
nonSystemVmSearch.and().op("vmTypeNnull", nonSystemVmSearch.entity().getVmType(), Op.NULL);
nonSystemVmSearch.or("vmType", nonSystemVmSearch.entity().getVmType(), Op.NOTIN);
nonSystemVmSearch.cp();
sb.join("nonSystemVms", nonSystemVmSearch, sb.entity().getAddress(),
nonSystemVmSearch.entity().getIp4Address(), JoinType.LEFTOUTER);
omitSystemVmIps = true;
}
SearchCriteria<IPAddressVO> sc = sb.create();
if (isAllocated) {
_accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria);
@ -1814,10 +1801,6 @@ public class ManagementServerImpl implements ManagementServer {
count++;
}
}
if (omitSystemVmIps) {
sc.setJoinParameters("nonSystemVms", "vmType", VirtualMachine.Type.ConsoleProxy, VirtualMachine.Type.SecondaryStorageVm);
}
if (zone != null) {
sc.setParameters("dataCenterId", zone);