Skip to content

Commit b105716

Browse files
committed
Merge branch '4.19'
2 parents 1ef0833 + eaab991 commit b105716

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

server/src/main/java/com/cloud/template/HypervisorTemplateAdapter.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@
3535
import org.apache.cloudstack.agent.directdownload.CheckUrlCommand;
3636
import org.apache.cloudstack.annotation.AnnotationService;
3737
import org.apache.cloudstack.annotation.dao.AnnotationDao;
38+
import org.apache.cloudstack.api.ApiCommandResourceType;
3839
import org.apache.cloudstack.api.command.user.iso.DeleteIsoCmd;
3940
import org.apache.cloudstack.api.command.user.iso.GetUploadParamsForIsoCmd;
4041
import org.apache.cloudstack.api.command.user.iso.RegisterIsoCmd;
4142
import org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd;
4243
import org.apache.cloudstack.api.command.user.template.GetUploadParamsForTemplateCmd;
4344
import org.apache.cloudstack.api.command.user.template.RegisterTemplateCmd;
45+
import org.apache.cloudstack.context.CallContext;
4446
import org.apache.cloudstack.direct.download.DirectDownloadManager;
4547
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
4648
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
@@ -419,6 +421,16 @@ public List<TemplateOrVolumePostUploadCommand> doInTransaction(TransactionStatus
419421
if (zoneIdList.size() > 1)
420422
throw new CloudRuntimeException("Operation is not supported for more than one zone id at a time.");
421423

424+
// Set Event Details for Template/ISO Upload
425+
String eventType = template.getFormat().equals(ImageFormat.ISO) ? "Iso" : "Template";
426+
String eventResourceId = template.getUuid();
427+
CallContext.current().setEventDetails(String.format("%s Id: %s", eventType, eventResourceId));
428+
CallContext.current().putContextParameter(eventType.equals("Iso") ? eventType : VirtualMachineTemplate.class, eventResourceId);
429+
if (template.getFormat().equals(ImageFormat.ISO)) {
430+
CallContext.current().setEventResourceType(ApiCommandResourceType.Iso);
431+
CallContext.current().setEventResourceId(template.getId());
432+
}
433+
422434
Long zoneId = zoneIdList.get(0);
423435
DataStore imageStore = verifyHeuristicRulesForZone(template, zoneId);
424436
List<TemplateOrVolumePostUploadCommand> payloads = new LinkedList<>();

0 commit comments

Comments
 (0)