fix logic used to obtain and register entity UUID

This commit is contained in:
erikbocks 2026-01-19 14:09:19 -03:00
parent 2b5b429c00
commit d4b86bb352
1 changed files with 3 additions and 2 deletions

View File

@ -43,6 +43,7 @@ import org.apache.cloudstack.api.BaseAsyncCreateCmd;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.BaseCmd.CommandType;
import org.apache.cloudstack.api.EntityReference;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
@ -532,11 +533,11 @@ public class ParamProcessWorker implements DispatchWorker {
// Populate CallContext for each of the entity.
for (final Class<?> entity : entities) {
CallContext.current().putContextParameter(entity, internalId);
final Object objVO = _entityMgr.findByUuidIncludingRemoved(entity, uuid);
final Object objVO = _entityMgr.findByIdIncludingRemoved(entity, internalId);
if (objVO == null) {
continue;
}
CallContext.current().putApiResourceUuid(annotation.name(), uuid);
CallContext.current().putApiResourceUuid(annotation.name(), ((Identity) objVO).getUuid());
}
validateNaturalNumber(internalId, annotation.name());
return internalId;