CharlesQueiroz commented on code in PR #7274:
URL: https://github.com/apache/cloudstack/pull/7274#discussion_r1154202274
##########
server/src/main/java/com/cloud/resourcelimit/ResourceLimitManagerImpl.java:
##########
@@ -979,19 +990,66 @@ public long countCpusForAccount(long accountId) {
SearchCriteria<UserVmJoinVO> sc1 = userVmSearch.create();
sc1.setParameters("accountId", accountId);
if (VirtualMachineManager.ResourceCountRunningVMsonly.value())
- sc1.setParameters("state", new Object[] {State.Destroyed,
State.Error, State.Expunging, State.Stopped});
+ sc1.setParameters("state", State.Destroyed, State.Error,
State.Expunging, State.Stopped);
else
- sc1.setParameters("state", new Object[] {State.Destroyed,
State.Error, State.Expunging});
+ sc1.setParameters("state", State.Destroyed, State.Error,
State.Expunging);
sc1.setParameters("displayVm", 1);
List<UserVmJoinVO> userVms = _userVmJoinDao.search(sc1,null);
for (UserVmJoinVO vm : userVms) {
- cputotal += Long.valueOf(vm.getCpu());
+ cputotal += vm.getCpu();
+ }
+ ServiceOffering defaultRouterOffering = null;
+ String globalRouterOffering =
VirtualNetworkApplianceManager.VirtualRouterServiceOffering.value();
+ if (globalRouterOffering != null) {
+ defaultRouterOffering =
serviceOfferingDao.findByUuid(globalRouterOffering);
+ }
+ if (defaultRouterOffering == null) {
+ defaultRouterOffering =
serviceOfferingDao.findByName(ServiceOffering.routerDefaultOffUniqueName);
+ }
Review Comment:
@JoaoJandre, sorry about that, but could you be a little more specific? I
couldn't find the method `getServiceOfferingByConfig()` in any place to use it.
--
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]