Network destroy: when release ip addresses assigned to the network, no need to send applyIpAssociations command to the network elements as they are already shutdown.

This commit is contained in:
alena 2011-01-28 10:05:07 -08:00
parent cddfd75595
commit 620466d393
2 changed files with 2 additions and 10 deletions

View File

@ -1656,15 +1656,10 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
List<IPAddressVO> ipsToRelease = _ipAddressDao.listByAssociatedNetwork(networkId);
if (ipsToRelease != null && !ipsToRelease.isEmpty()) {
for (IPAddressVO ip : ipsToRelease) {
if (!releasePublicIpAddress(ip.getAddress(), ip.getAccountId(), callerUserId)) {
s_logger.warn("Failed to deallocate ip address as a part of network id=" + networkId + " destroy");
success = false;
}
_ipAddressDao.unassignIpAddress(ip.getAddress());
}
if (success) {
s_logger.debug("Ip addresses are deallocated successfully as a part of network id=" + networkId + " destroy");
}
s_logger.debug("Ip addresses are unassigned successfully as a part of network id=" + networkId + " destroy");
}
for (NetworkElement element : _networkElements) {

View File

@ -58,9 +58,6 @@ import com.cloud.configuration.dao.ResourceLimitDao;
import com.cloud.domain.Domain;
import com.cloud.domain.DomainVO;
import com.cloud.domain.dao.DomainDao;
import com.cloud.event.EventTypes;
import com.cloud.event.EventUtils;
import com.cloud.event.EventVO;
import com.cloud.exception.AgentUnavailableException;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InvalidParameterValueException;