shwstppr commented on a change in pull request #4154:
URL: https://github.com/apache/cloudstack/pull/4154#discussion_r443102528



##########
File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -3624,25 +3624,30 @@ private void fillVMOrTemplateDetailOptions(final 
Map<String, List<String>> optio
             if (domainId != null) {
                 SearchCriteria<AffinityGroupJoinVO> scDomain = 
buildAffinityGroupSearchCriteria(null, isRecursive, new ArrayList<Long>(), 
listProjectResourcesCriteria, affinityGroupId,
                         affinityGroupName, affinityGroupType, keyword);
-                affinityGroups.addAll(listDomainLevelAffinityGroups(scDomain, 
searchFilter, domainId));
+                List<AffinityGroupJoinVO> groups = 
listDomainLevelAffinityGroups(scDomain, searchFilter, domainId);
+                affinityGroups.addAll(groups);
+                count += groups.size();
             } else {
 
                 for (Long permAcctId : permittedAccounts) {
                     Account permittedAcct = _accountDao.findById(permAcctId);
                     SearchCriteria<AffinityGroupJoinVO> scDomain = 
buildAffinityGroupSearchCriteria(null, isRecursive, new ArrayList<Long>(), 
listProjectResourcesCriteria, affinityGroupId,
                             affinityGroupName, affinityGroupType, keyword);
-
-                    
affinityGroups.addAll(listDomainLevelAffinityGroups(scDomain, searchFilter, 
permittedAcct.getDomainId()));
+                    List<AffinityGroupJoinVO> groups = 
listDomainLevelAffinityGroups(scDomain, searchFilter, 
permittedAcct.getDomainId());

Review comment:
       @davidjumani I think it might. Will check and fix if needed cc @rhtyd




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to