bug 5370: copy Template/Iso - generating the started and completed events.

status 5370: resolved fixed
This commit is contained in:
Nitin 2011-08-11 16:14:27 +05:30
parent 16803387c6
commit 56ce65710d
2 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,7 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.StorageUnavailableException;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
@Implementation(description="Copies a template from one zone to another.", responseObject=TemplateResponse.class)
public class CopyTemplateCmd extends BaseAsyncCmd {
@ -117,6 +118,7 @@ public class CopyTemplateCmd extends BaseAsyncCmd {
@Override
public void execute() throws ResourceAllocationException{
try {
UserContext.current().setEventDetails(getEventDescription());
VirtualMachineTemplate template = _templateService.copyTemplate(this);
if (template != null){

View File

@ -588,6 +588,7 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
@Override
@ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_COPY, eventDescription = "copying template", async = true)
public VirtualMachineTemplate copyTemplate(CopyTemplateCmd cmd) throws StorageUnavailableException, ResourceAllocationException {
Long templateId = cmd.getId();
Long userId = UserContext.current().getCallerUserId();