cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [10/41] git commit: updated refs/heads/4.4 to 010a217
Date Thu, 11 Dec 2014 16:53:50 GMT
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/f9ae3bbc
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f9ae3bbc
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f9ae3bbc

Branch: refs/heads/4.4
Commit: f9ae3bbc98281654acc80eda1f3822513c223e7e
Parents: 7a8ac87
Author: Min Chen <min.chen@citrix.com>
Authored: Mon Nov 17 15:04:03 2014 -0800
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu Dec 11 20:19:22 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/f9ae3bbc/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 18a155f..20080c2 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -623,9 +623,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);
@@ -645,8 +644,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