mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
BUG-ID: CS-27662: ListTags API is ignoring the resourceID and displaying
all the tags of all resources. Reviewed-by: Frank
This commit is contained in:
parent
d2d448c401
commit
3014fd0089
@ -653,9 +653,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);
|
||||
@ -675,8 +674,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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user