mirror of https://github.com/apache/cloudstack.git
bug 12107: don't show public ip addresses associated with CPVM/SSVM
status 12107: resolved fixed
This commit is contained in:
parent
22f6ad7566
commit
c2146ea8e8
|
|
@ -170,23 +170,11 @@ public class ListPublicIpAddressesCmd extends BaseListCmd {
|
|||
return allocatedOnly;
|
||||
}
|
||||
|
||||
public void setAllocatedOnly(Boolean allocatedOnly) {
|
||||
this.allocatedOnly = allocatedOnly;
|
||||
}
|
||||
|
||||
public Boolean getForVirtualNetwork() {
|
||||
return forVirtualNetwork;
|
||||
}
|
||||
|
||||
public void setForVirtualNetwork(Boolean forVirtualNetwork) {
|
||||
this.forVirtualNetwork = forVirtualNetwork;
|
||||
}
|
||||
|
||||
public Boolean getForLoadBalancing() {
|
||||
return forLoadBalancing;
|
||||
}
|
||||
|
||||
public void setForLoadBalancing(Boolean forLoadBalancing) {
|
||||
this.forLoadBalancing = forLoadBalancing;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1908,8 +1908,22 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
vlanSearch.and("vlanType", vlanSearch.entity().getVlanType(), SearchCriteria.Op.EQ);
|
||||
sb.join("vlanSearch", vlanSearch, sb.entity().getVlanId(), vlanSearch.entity().getId(), JoinBuilder.JoinType.INNER);
|
||||
|
||||
boolean allocatedOnly = false;
|
||||
if ((isAllocated != null) && (isAllocated == true)) {
|
||||
sb.and("allocated", sb.entity().getAllocatedTime(), SearchCriteria.Op.NNULL);
|
||||
allocatedOnly = true;
|
||||
}
|
||||
|
||||
VlanType vlanType = null;
|
||||
if (forVirtualNetwork != null) {
|
||||
vlanType = (Boolean) forVirtualNetwork ? VlanType.VirtualNetwork : VlanType.DirectAttached;
|
||||
} else {
|
||||
vlanType = VlanType.VirtualNetwork;
|
||||
}
|
||||
|
||||
//don't show SSVM/CPVM ips
|
||||
if (vlanType == VlanType.VirtualNetwork && (allocatedOnly)) {
|
||||
sb.and("associatedNetworkId", sb.entity().getAssociatedWithNetworkId(), SearchCriteria.Op.NNULL);
|
||||
}
|
||||
|
||||
SearchCriteria<IPAddressVO> sc = sb.create();
|
||||
|
|
@ -1920,13 +1934,6 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
sc.setJoinParameters("domainSearch", "path", domain.getPath() + "%");
|
||||
}
|
||||
|
||||
VlanType vlanType = null;
|
||||
if (forVirtualNetwork != null) {
|
||||
vlanType = (Boolean) forVirtualNetwork ? VlanType.VirtualNetwork : VlanType.DirectAttached;
|
||||
} else {
|
||||
vlanType = VlanType.VirtualNetwork;
|
||||
}
|
||||
|
||||
sc.setJoinParameters("vlanSearch", "vlanType", vlanType);
|
||||
|
||||
if (zone != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue