From 2f7ebc7c54e1e1c7815bf292dc97d1ecae849776 Mon Sep 17 00:00:00 2001 From: Abhinandan Prateek Date: Wed, 29 Jul 2015 19:34:14 +0530 Subject: [PATCH] quota: fixed permisison and date flip --- .../src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java | 2 +- .../quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java index edfce72fe08..18e56b54291 100644 --- a/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java +++ b/plugins/database/quota/src/org/apache/cloudstack/api/command/QuotaBalanceCmd.java @@ -112,7 +112,7 @@ public class QuotaBalanceCmd extends BaseCmd { @Override public long getEntityOwnerId() { - Long accountId = _accountService.finalyzeAccountId(accountName, domainId, null, true); + Long accountId = _accountService.getActiveAccountByName(accountName, domainId).getAccountId(); if (accountId == null) { return CallContext.current().getCallingAccount().getId(); } diff --git a/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java b/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java index 30069dcb190..be0935a0702 100644 --- a/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java +++ b/plugins/database/quota/src/org/apache/cloudstack/quota/QuotaServiceImpl.java @@ -174,7 +174,7 @@ public class QuotaServiceImpl extends ManagerBase implements QuotaService, Confi } else if (endDate.after(startOfNextDay(new Date()))) { throw new InvalidParameterValueException("Incorrect Date Range. End date:" + endDate + " should not be in future. "); } else if (startDate.before(endDate)) { - Date adjustedEndDate = startOfNextDay(endDate); + Date adjustedEndDate = computeAdjustedTime(startOfNextDay(endDate)); s_logger.debug("Getting quota balance records for account: " + accountId + ", domainId: " + domainId + ", between " + adjustedStartDate + " and " + adjustedEndDate); List qbrecords = _quotaBalanceDao.findQuotaBalance(accountId, domainId, adjustedStartDate, adjustedEndDate); s_logger.info("Found records size=" + qbrecords.size());