Skip to content

Commit 789764a

Browse files
committed
fix vmtype listing issue
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 1c32efc commit 789764a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,11 @@ public List<UserVmJoinVO> listByHypervisorNotTypesAndOwners(Hypervisor.Hyperviso
849849
List<String> excludeTypes, List<Long> accountIds, String domainPath, Filter filter) {
850850
SearchBuilder<UserVmJoinVO> sb = createSearchBuilder();
851851
sb.and("hypervisorType", sb.entity().getHypervisorType(), Op.EQ);
852-
sb.and("type", sb.entity().getUserVmType(), Op.NOTIN);
852+
if (CollectionUtils.isNotEmpty(excludeTypes)) {
853+
sb.and().op("typeNull", sb.entity().getUserVmType(), Op.NULL);
854+
sb.or("type", sb.entity().getUserVmType(), Op.NOTIN);
855+
sb.cp();
856+
}
853857
boolean accountIdsNotEmpty = CollectionUtils.isNotEmpty(accountIds);
854858
boolean domainPathNotBlank = StringUtils.isNotBlank(domainPath);
855859
if (accountIdsNotEmpty || domainPathNotBlank) {

0 commit comments

Comments
 (0)