Skip to content

Commit

Permalink
Merge branch '4.19'
Browse files Browse the repository at this point in the history
  • Loading branch information
nvazquez committed Aug 20, 2024
2 parents 1ef0833 + eaab991 commit b105716
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@
import org.apache.cloudstack.agent.directdownload.CheckUrlCommand;
import org.apache.cloudstack.annotation.AnnotationService;
import org.apache.cloudstack.annotation.dao.AnnotationDao;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.command.user.iso.DeleteIsoCmd;
import org.apache.cloudstack.api.command.user.iso.GetUploadParamsForIsoCmd;
import org.apache.cloudstack.api.command.user.iso.RegisterIsoCmd;
import org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd;
import org.apache.cloudstack.api.command.user.template.GetUploadParamsForTemplateCmd;
import org.apache.cloudstack.api.command.user.template.RegisterTemplateCmd;
import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.direct.download.DirectDownloadManager;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
Expand Down Expand Up @@ -419,6 +421,16 @@ public List<TemplateOrVolumePostUploadCommand> doInTransaction(TransactionStatus
if (zoneIdList.size() > 1)
throw new CloudRuntimeException("Operation is not supported for more than one zone id at a time.");

// Set Event Details for Template/ISO Upload
String eventType = template.getFormat().equals(ImageFormat.ISO) ? "Iso" : "Template";
String eventResourceId = template.getUuid();
CallContext.current().setEventDetails(String.format("%s Id: %s", eventType, eventResourceId));
CallContext.current().putContextParameter(eventType.equals("Iso") ? eventType : VirtualMachineTemplate.class, eventResourceId);
if (template.getFormat().equals(ImageFormat.ISO)) {
CallContext.current().setEventResourceType(ApiCommandResourceType.Iso);
CallContext.current().setEventResourceId(template.getId());
}

Long zoneId = zoneIdList.get(0);
DataStore imageStore = verifyHeuristicRulesForZone(template, zoneId);
List<TemplateOrVolumePostUploadCommand> payloads = new LinkedList<>();
Expand Down

0 comments on commit b105716

Please sign in to comment.