cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [2/18] git commit: CS-15459: fixed listTags by resourceType
Date Tue, 10 Jul 2012 01:31:07 GMT
CS-15459: fixed listTags by resourceType


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

Branch: refs/heads/vpc
Commit: 84cdf2c28de5ca19626f780e9638ee1d53287334
Parents: 10e70bc
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Mon Jul 9 14:56:30 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Mon Jul 9 14:59:58 2012 -0700

----------------------------------------------------------------------
 .../com/cloud/tags/TaggedResourceManagerImpl.java  |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/84cdf2c2/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
index 0386425..f79eba4 100644
--- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
+++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
@@ -325,9 +325,13 @@ public class TaggedResourceManagerImpl implements TaggedResourceService,
Manager
 
        sb.and("key", sb.entity().getKey(), SearchCriteria.Op.EQ);
        sb.and("value", sb.entity().getValue(), SearchCriteria.Op.EQ);
-       sb.and().op("resourceId", sb.entity().getResourceId(), SearchCriteria.Op.EQ);
-       sb.or("resourceUuid", sb.entity().getResourceUuid(), SearchCriteria.Op.EQ);
-       sb.cp();
+       
+       if (resourceId != null) {
+           sb.and().op("resourceId", sb.entity().getResourceId(), SearchCriteria.Op.EQ);
+           sb.or("resourceUuid", sb.entity().getResourceUuid(), SearchCriteria.Op.EQ);
+           sb.cp();  
+       }
+       
        sb.and("resourceType", sb.entity().getResourceType(), SearchCriteria.Op.EQ);
        sb.and("customer", sb.entity().getCustomer(), SearchCriteria.Op.EQ);
        


Mime
View raw message