|
35 | 35 | import javax.inject.Inject; |
36 | 36 | import javax.naming.ConfigurationException; |
37 | 37 |
|
38 | | -import org.apache.commons.codec.binary.Base64; |
39 | | -import org.apache.log4j.Logger; |
40 | | - |
41 | 38 | import org.apache.cloudstack.acl.ControlledEntity.ACLType; |
42 | 39 | import org.apache.cloudstack.acl.SecurityChecker.AccessType; |
43 | 40 | import org.apache.cloudstack.affinity.AffinityGroupService; |
|
47 | 44 | import org.apache.cloudstack.api.ApiConstants; |
48 | 45 | import org.apache.cloudstack.api.BaseCmd.HTTPMethod; |
49 | 46 | import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd; |
50 | | -import org.apache.cloudstack.api.command.admin.vm.ExpungeVMCmd; |
51 | 47 | import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd; |
52 | 48 | import org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd; |
53 | 49 | import org.apache.cloudstack.api.command.user.vm.DeployVMCmd; |
|
87 | 83 | import org.apache.cloudstack.storage.command.DettachCommand; |
88 | 84 | import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; |
89 | 85 | import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; |
| 86 | +import org.apache.commons.codec.binary.Base64; |
| 87 | +import org.apache.log4j.Logger; |
90 | 88 |
|
91 | 89 | import com.cloud.agent.AgentManager; |
92 | 90 | import com.cloud.agent.api.Answer; |
@@ -1800,7 +1798,7 @@ protected void runInContext() { |
1800 | 1798 | } |
1801 | 1799 | for (UserVmVO vm : vms) { |
1802 | 1800 | try { |
1803 | | - expunge(vm, _accountMgr.getSystemUser().getId(), _accountMgr.getSystemAccount()); |
| 1801 | + expungeVm(vm.getId()); |
1804 | 1802 | } catch (Exception e) { |
1805 | 1803 | s_logger.warn("Unable to expunge " + vm, e); |
1806 | 1804 | } |
@@ -2090,12 +2088,6 @@ public UserVm destroyVm(DestroyVMCmd cmd) throws ResourceUnavailableException, C |
2090 | 2088 | return destroyedVm; |
2091 | 2089 | } |
2092 | 2090 |
|
2093 | | - @Override |
2094 | | - @ActionEvent(eventType = EventTypes.EVENT_VM_EXPUNGE, eventDescription = "expunging Vm", async = true) |
2095 | | - public UserVm expungeVm(ExpungeVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException { |
2096 | | - return expungeVm(cmd.getId()); |
2097 | | - } |
2098 | | - |
2099 | 2091 | @Override |
2100 | 2092 | @DB |
2101 | 2093 | public InstanceGroupVO createVmGroup(CreateVMGroupCmd cmd) { |
@@ -3596,6 +3588,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { |
3596 | 3588 | } |
3597 | 3589 |
|
3598 | 3590 | @Override |
| 3591 | + @ActionEvent(eventType = EventTypes.EVENT_VM_EXPUNGE, eventDescription = "expunging Vm", async = true) |
3599 | 3592 | public UserVm expungeVm(long vmId) throws ResourceUnavailableException, ConcurrentOperationException { |
3600 | 3593 | Account caller = CallContext.current().getCallingAccount(); |
3601 | 3594 | Long userId = caller.getId(); |
|
0 commit comments