listPublicIpAddresses api: don't set associatedWithNetworkId if corresponding field is null in the DB
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/d52c6e23 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/d52c6e23 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/d52c6e23 Branch: refs/heads/vpc Commit: d52c6e23134442d948782e4d267685902c80c346 Parents: 10dcc11 Author: Alena Prokharchyk <[email protected]> Authored: Mon Jul 9 10:10:53 2012 -0700 Committer: Alena Prokharchyk <[email protected]> Committed: Mon Jul 9 18:13:32 2012 -0700 ---------------------------------------------------------------------- server/src/com/cloud/api/ApiResponseHelper.java | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/d52c6e23/server/src/com/cloud/api/ApiResponseHelper.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 5dfc647..e056b7b 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -794,14 +794,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;
