cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/4.5 to 66e0f04
Date Thu, 20 Nov 2014 17:57:17 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 91d448ff4 -> 66e0f049d


CLOUDSTACK-7954:ListTags API is ignoring the resourceID and displaying
    all the tags of all resources.


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

Branch: refs/heads/4.5
Commit: 66e0f049db0a996476a2e6bbf3dd9041ef1ace1a
Parents: 91d448f
Author: Min Chen <min.chen@citrix.com>
Authored: Mon Nov 17 15:04:03 2014 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Thu Nov 20 09:48:07 2014 -0800

----------------------------------------------------------------------
 server/src/com/cloud/api/query/QueryManagerImpl.java | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/66e0f049/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 475b42c..31273ec 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -648,9 +648,8 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         sb.and("value", sb.entity().getValue(), SearchCriteria.Op.EQ);
 
         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("resourceId", sb.entity().getResourceId(), SearchCriteria.Op.EQ);
+            sb.and("resourceUuid", sb.entity().getResourceUuid(), SearchCriteria.Op.EQ);
         }
 
         sb.and("resourceType", sb.entity().getResourceType(), SearchCriteria.Op.EQ);
@@ -670,8 +669,13 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         }
 
         if (resourceId != null) {
-            sc.setParameters("resourceId", resourceId);
-            sc.setParameters("resourceUuid", resourceId);
+            try {
+                long rid = Long.parseLong(resourceId);
+                sc.setParameters("resourceId", rid);
+            } catch (NumberFormatException ex) {
+                // internal id instead of resource id is passed
+                sc.setParameters("resourceUuid", resourceId);
+            }
         }
 
         if (resourceType != null) {


Mime
View raw message