mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7954:ListTags API is ignoring the resourceID and displaying
all the tags of all resources.
This commit is contained in:
parent
7de9d2f002
commit
5fa7801b20
|
|
@ -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…
Reference in New Issue