Stephen Hoogendijk created CLOUDSTACK-7362:
----------------------------------------------

             Summary: Resource tagging sometimes tags the wrong resource
                 Key: CLOUDSTACK-7362
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7362
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
            Reporter: Stephen Hoogendijk


This problem occurs when the uuid of the resource you are about to tag begins 
with a number that actually corresponds to the id field of an entry in the same 
resource type table.

Example:

We want to tag security group with UUID 6cb95038-6b76-4905-bdf5-85bf0e0eda51 
which has ID #5. But we also have a security group with ID #6 and UUID 
d582e52c-f3c1-4e12-8e86-9dad0a5bd725. What happens is the following:

First it runs this method:

long id = getResourceId(resourceId, resourceType);

which actually tries to find the entity by its UUID and returns the resource id 
(numeric). This process goes off without a hitch.

Next, it actually tries to find the UUID of the resource (because you can also 
send in the internal (numeric) identifier):

String resourceUuid = getUuid(resourceId, resourceType)

Now this is when the magic starts happening, this is what's happening inside 
the method:




--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to