cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.3 to eaaac81
Date Fri, 21 Nov 2014 13:23:20 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3 5563a7314 -> eaaac8187


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

(cherry picked from commit 5fa7801b20f3ffb4fe0ae0380167873dfbc346ba)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.3
Commit: eaaac8187092444f48caa1fa5d1c90dc96391a76
Parents: 5563a73
Author: Min Chen <min.chen@citrix.com>
Authored: Mon Nov 17 15:04:03 2014 -0800
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Fri Nov 21 18:52:28 2014 +0530

----------------------------------------------------------------------
 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/eaaac818/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 06def7f..5117d7a 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -616,9 +616,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);
@@ -638,8 +637,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