VPC: CS-15345 - fixed regression in ipRelease happening as a part of cleanupNetworkResources method

This commit is contained in:
Alena Prokharchyk 2012-07-10 14:32:52 -07:00
parent e4a00f1faf
commit 3caffc7855
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,6 @@ package com.cloud.network.rules;
import java.util.List;
import com.cloud.acl.ControlledEntity;
import com.cloud.network.rules.FirewallRule.TrafficType;
public interface FirewallRule extends ControlledEntity {
enum Purpose {

View File

@ -6040,9 +6040,11 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
//release all ip addresses
List<IPAddressVO> ipsToRelease = _ipAddressDao.listByAssociatedNetwork(networkId, null);
for (IPAddressVO ipToRelease : ipsToRelease) {
if (ipToRelease.getVpcId() != null) {
if (ipToRelease.getVpcId() == null) {
IPAddressVO ip = markIpAsUnavailable(ipToRelease.getId());
assert (ip != null) : "Unable to mark the ip address id=" + ipToRelease.getId() + " as unavailable.";
} else {
unassignIPFromVpcNetwork(ipToRelease.getId());
}
}