incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [2/17] git commit: CS-15459: fixed listTags by resourceType
Date Wed, 11 Jul 2012 20:18: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/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/vpc
Commit: ab2669b01d083dcb15fed94da27b534a779f1adc
Parents: d3c0110
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Mon Jul 9 14:56:30 2012 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@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);
        


Mime
View raw message