Skip to content

Commit b20e29c

Browse files
Ryan Dietrichchipchilders
authored andcommitted
CLOUDSTACK-1989: Without this fix you can't query service offerings
that don't have a domain id set (null). Tested via: Called "listServiceOfferings" using a simple perl script, once with an ID, and once without an ID specified. Signed-off-by: Chip Childers <chip.childers@gmail.com>
1 parent 641594a commit b20e29c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎server/src/com/cloud/api/query/QueryManagerImpl.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,11 @@ private Pair<List<ServiceOfferingJoinVO>, Integer> searchForServiceOfferingsInte
21022102
domainRecord = _domainDao.findById(domainRecord.getParent());
21032103
domainIds.add(domainRecord.getId());
21042104
}
2105-
sc.addAnd("domainId", SearchCriteria.Op.IN, domainIds.toArray());
2105+
SearchCriteria<ServiceOfferingJoinVO> spc = _srvOfferingJoinDao.createSearchCriteria();
2106+
2107+
spc.addOr("domainId", SearchCriteria.Op.IN, domainIds.toArray());
2108+
spc.addOr("domainId", SearchCriteria.Op.NULL);
2109+
sc.addAnd("domainId", SearchCriteria.Op.SC, spc);
21062110

21072111
// include also public offering if no keyword, name and id specified
21082112
if ( keyword == null && name == null && id == null ){

0 commit comments

Comments
 (0)