Skip to content

Commit d79cb38

Browse files
committed
Fix a listAccount regression due to root admin role refactoring.
1 parent 283ec27 commit d79cb38

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎server/src/com/cloud/api/ApiDBUtils.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,8 @@ public static long findCorrectResourceLimit(ResourceType type, long accountId) {
713713
return _resourceLimitMgr.findCorrectResourceLimitForAccount(account, type);
714714
}
715715

716-
public static long findCorrectResourceLimit(Long limit, long accountId, ResourceType type) {
717-
return _resourceLimitMgr.findCorrectResourceLimitForAccount(accountId, limit, type);
716+
public static long findCorrectResourceLimit(Long limit, short accountType, ResourceType type) {
717+
return _resourceLimitMgr.findCorrectResourceLimitForAccount(accountType, limit, type);
718718
}
719719

720720
public static long getResourceCount(ResourceType type, long accountId) {

‎server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public AccountResponse newAccountResponse(AccountJoinVO account) {
8080
setResourceLimits(account, accountIsAdmin, accountResponse);
8181

8282
//get resource limits for projects
83-
long projectLimit = ApiDBUtils.findCorrectResourceLimit(account.getProjectLimit(), account.getId(), ResourceType.project);
83+
long projectLimit = ApiDBUtils.findCorrectResourceLimit(account.getProjectLimit(), account.getType(), ResourceType.project);
8484
String projectLimitDisplay = (accountIsAdmin || projectLimit == -1) ? "Unlimited" : String.valueOf(projectLimit);
8585
long projectTotal = (account.getProjectTotal() == null) ? 0 : account.getProjectTotal();
8686
String projectAvail = (accountIsAdmin || projectLimit == -1) ? "Unlimited" : String.valueOf(projectLimit - projectTotal);
@@ -115,7 +115,7 @@ public AccountResponse newAccountResponse(AccountJoinVO account) {
115115
@Override
116116
public void setResourceLimits(AccountJoinVO account, boolean accountIsAdmin, ResourceLimitAndCountResponse response) {
117117
// Get resource limits and counts
118-
long vmLimit = ApiDBUtils.findCorrectResourceLimit(account.getVmLimit(), account.getId(), ResourceType.user_vm);
118+
long vmLimit = ApiDBUtils.findCorrectResourceLimit(account.getVmLimit(), account.getType(), ResourceType.user_vm);
119119
String vmLimitDisplay = (accountIsAdmin || vmLimit == -1) ? "Unlimited" : String.valueOf(vmLimit);
120120
long vmTotal = (account.getVmTotal() == null) ? 0 : account.getVmTotal();
121121
String vmAvail = (accountIsAdmin || vmLimit == -1) ? "Unlimited" : String.valueOf(vmLimit - vmTotal);

0 commit comments

Comments
 (0)