Damans227 commented on code in PR #14036:
URL: https://github.com/apache/cloudstack/pull/14036#discussion_r4199137892
##########
server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java:
##########
@@ -1780,8 +1780,8 @@ private boolean copySnapshotOnPool(SnapshotInfo snapshot,
SnapshotStrategy snaps
return false;
}
snapshotZoneDao.addSnapshotToZone(snapshot.getId(),
snapshotOnStore.getDataCenterId());
-
_resourceLimitMgr.incrementResourceCount(CallContext.current().getCallingUserId(),
ResourceType.primary_storage, snapshot.getSize());
- if (CallContext.current().getCallingUserId() !=
Account.ACCOUNT_ID_SYSTEM) {
+ _resourceLimitMgr.incrementResourceCount(snapshot.getAccountId(),
ResourceType.primary_storage, snapshot.getSize());
+ if (CallContext.current().getCallingAccountId() !=
Account.ACCOUNT_ID_SYSTEM) {
SnapshotVO snapshotVO =
_snapshotDao.findByIdIncludingRemoved(snapshot.getSnapshotId());
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_SNAPSHOT_COPY,
CallContext.current().getCallingAccountId(), snapshotOnStore.getDataCenterId(),
snapshotVO.getId(), null, null, null, snapshotVO.getSize(),
Review Comment:
that covers it, thanks. f2dfb468b4 sends the usage record to the owner now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]