mirror of https://github.com/apache/cloudstack.git
Generate usage event when Ip is released as a part of network destroy
This commit is contained in:
parent
b23df4c7e3
commit
a267d1c261
|
|
@ -1657,6 +1657,10 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
if (ipsToRelease != null && !ipsToRelease.isEmpty()) {
|
||||
for (IPAddressVO ip : ipsToRelease) {
|
||||
_ipAddressDao.unassignIpAddress(ip.getAddress());
|
||||
if(ip.getAccountId() != Account.ACCOUNT_ID_SYSTEM){
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_NET_IP_RELEASE, ip.getAccountId(), ip.getDataCenterId(), 0, ip.getAddress().toString());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
}
|
||||
}
|
||||
|
||||
s_logger.debug("Ip addresses are unassigned successfully as a part of network id=" + networkId + " destroy");
|
||||
|
|
|
|||
Loading…
Reference in New Issue