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 2012/07/11 21:09:51 UTC

git commit: CS-15459: fixed listTags by resourceType

Updated Branches:
  refs/heads/master d3c0110d0 -> ab2669b01


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/ab2669b0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/ab2669b0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/ab2669b0

Branch: refs/heads/master
Commit: ab2669b01d083dcb15fed94da27b534a779f1adc
Parents: d3c0110
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Mon Jul 9 14:56:30 2012 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Jul 11 12:08:34 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/ab2669b0/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);