mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
bug 7951: Added source nat field for ip address usage
status 7951: resolved fixed
This commit is contained in:
parent
057e76c65b
commit
dcd12c213c
@ -238,8 +238,9 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
||||
if (!_ipAddressDao.update(addr.getAddress(), addr)) {
|
||||
throw new CloudRuntimeException("Found address to allocate but unable to update: " + addr);
|
||||
}
|
||||
if(!sourceNat && (owner.getAccountId() != Account.ACCOUNT_ID_SYSTEM)){
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_NET_IP_ASSIGN, owner.getAccountId(), dcId, 0, addr.getAddress().toString());
|
||||
if(owner.getAccountId() != Account.ACCOUNT_ID_SYSTEM){
|
||||
long isSourceNat = (sourceNat) ? 1 : 0 ;
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_NET_IP_ASSIGN, owner.getAccountId(), dcId, isSourceNat, addr.getAddress().toString());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
}
|
||||
|
||||
@ -633,7 +634,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
||||
if (success) {
|
||||
_ipAddressDao.unassignIpAddress(addr);
|
||||
s_logger.debug("released a public ip: " + addr);
|
||||
if(!ip.isSourceNat() && (ownerId != Account.ACCOUNT_ID_SYSTEM)){
|
||||
if(ownerId != Account.ACCOUNT_ID_SYSTEM){
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_NET_IP_RELEASE, ownerId, ip.getDataCenterId(), 0, addr.toString());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user