listPublicIpAddresses api: don't set associatedWithNetworkId if corresponding field is null in the DB

This commit is contained in:
Alena Prokharchyk 2012-07-09 10:10:53 -07:00
parent 98f8e70ca9
commit 03138dee07
1 changed files with 1 additions and 7 deletions

View File

@ -793,14 +793,8 @@ public class ApiResponseHelper implements ResponseGenerator {
ipResponse.setAssociatedNetworkId(ipAddr.getAssociatedWithNetworkId());
ipResponse.setVpcId(ipAddr.getVpcId());
// Network id the ip is associated withif associated networkId is null, try to get this information from vlan
Long associatedNetworkId = ipAddr.getAssociatedWithNetworkId();
// Network id the ip is associated with (if associated networkId is null, try to get this information from vlan)
Long vlanNetworkId = ApiDBUtils.getVlanNetworkId(ipAddr.getVlanId());
if (associatedNetworkId == null) {
associatedNetworkId = vlanNetworkId;
}
ipResponse.setAssociatedNetworkId(associatedNetworkId);
// Network id the ip belongs to
Long networkId;