Repository: cloudstack Updated Branches: refs/heads/master 3014fd008 -> 7de9d2f00
Revert "BUG-ID: CS-27662: ListTags API is ignoring the resourceID and displaying" This reverts commit 3014fd00895a8467e627b09845fb5de4fdc373b5. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7de9d2f0 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7de9d2f0 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7de9d2f0 Branch: refs/heads/master Commit: 7de9d2f002d190808f3a168d297554a0863b38e6 Parents: 3014fd0 Author: Min Chen <min.c...@citrix.com> Authored: Thu Nov 20 09:44:55 2014 -0800 Committer: Min Chen <min.c...@citrix.com> Committed: Thu Nov 20 09:44:55 2014 -0800 ---------------------------------------------------------------------- server/src/com/cloud/api/query/QueryManagerImpl.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7de9d2f0/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 418b81c..824bb9b 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -653,8 +653,9 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { sb.and("value", sb.entity().getValue(), SearchCriteria.Op.EQ); if (resourceId != null) { - sb.and("resourceId", sb.entity().getResourceId(), SearchCriteria.Op.EQ); - sb.and("resourceUuid", sb.entity().getResourceUuid(), SearchCriteria.Op.EQ); + 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); @@ -674,13 +675,8 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { } if (resourceId != null) { - 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); - } + sc.setParameters("resourceId", resourceId); + sc.setParameters("resourceUuid", resourceId); } if (resourceType != null) {