You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/04/13 00:37:55 UTC

[12/28] git commit: updated refs/heads/internallb to 3b41d5b

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 <ch...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/38df6286
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/38df6286
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/38df6286

Branch: refs/heads/internallb
Commit: 38df62865d905aeac49fac7c32b66c7099036867
Parents: accfccd
Author: Ryan Dietrich <ry...@betterservers.com>
Authored: Fri Apr 12 14:00:41 2013 +0100
Committer: Chip Childers <ch...@gmail.com>
Committed: Fri Apr 12 14:03:28 2013 +0100

----------------------------------------------------------------------
 .../src/com/cloud/api/query/QueryManagerImpl.java  |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/38df6286/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index a498c18..ea58427 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -2119,7 +2119,11 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
                 domainRecord = _domainDao.findById(domainRecord.getParent());
                 domainIds.add(domainRecord.getId());
             }
-            sc.addAnd("domainId", SearchCriteria.Op.IN, domainIds.toArray());
+            SearchCriteria<ServiceOfferingJoinVO> spc = _srvOfferingJoinDao.createSearchCriteria();
+
+            spc.addOr("domainId", SearchCriteria.Op.IN, domainIds.toArray());
+            spc.addOr("domainId", SearchCriteria.Op.NULL);
+            sc.addAnd("domainId", SearchCriteria.Op.SC, spc);
 
             // include also public offering if no keyword, name and id specified
             if ( keyword == null && name == null && id == null ){