mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
bug 5370: copy Template/Iso - generating the started and completed events.
status 5370: resolved fixed
This commit is contained in:
parent
16803387c6
commit
56ce65710d
@ -36,6 +36,7 @@ import com.cloud.exception.ResourceAllocationException;
|
|||||||
import com.cloud.exception.StorageUnavailableException;
|
import com.cloud.exception.StorageUnavailableException;
|
||||||
import com.cloud.template.VirtualMachineTemplate;
|
import com.cloud.template.VirtualMachineTemplate;
|
||||||
import com.cloud.user.Account;
|
import com.cloud.user.Account;
|
||||||
|
import com.cloud.user.UserContext;
|
||||||
|
|
||||||
@Implementation(description="Copies a template from one zone to another.", responseObject=TemplateResponse.class)
|
@Implementation(description="Copies a template from one zone to another.", responseObject=TemplateResponse.class)
|
||||||
public class CopyTemplateCmd extends BaseAsyncCmd {
|
public class CopyTemplateCmd extends BaseAsyncCmd {
|
||||||
@ -117,6 +118,7 @@ public class CopyTemplateCmd extends BaseAsyncCmd {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() throws ResourceAllocationException{
|
public void execute() throws ResourceAllocationException{
|
||||||
try {
|
try {
|
||||||
|
UserContext.current().setEventDetails(getEventDescription());
|
||||||
VirtualMachineTemplate template = _templateService.copyTemplate(this);
|
VirtualMachineTemplate template = _templateService.copyTemplate(this);
|
||||||
|
|
||||||
if (template != null){
|
if (template != null){
|
||||||
|
|||||||
@ -588,6 +588,7 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_COPY, eventDescription = "copying template", async = true)
|
||||||
public VirtualMachineTemplate copyTemplate(CopyTemplateCmd cmd) throws StorageUnavailableException, ResourceAllocationException {
|
public VirtualMachineTemplate copyTemplate(CopyTemplateCmd cmd) throws StorageUnavailableException, ResourceAllocationException {
|
||||||
Long templateId = cmd.getId();
|
Long templateId = cmd.getId();
|
||||||
Long userId = UserContext.current().getCallerUserId();
|
Long userId = UserContext.current().getCallerUserId();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user