cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [1/2] git commit: updated refs/heads/master to 66d5ebc
Date Wed, 07 May 2014 22:56:17 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 5388d349a -> 66d5ebc65


CLOUDSTACK-6595: call expunge method marked with @ActionEvent from expunge thread context.
So the action even EXPUNGE.VM is generated when vm is expunged by the thread.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/25ab05a1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/25ab05a1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/25ab05a1

Branch: refs/heads/master
Commit: 25ab05a189cf8c62f0add54c172d2e054b8bbd4f
Parents: 5388d34
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Wed May 7 13:44:26 2014 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Wed May 7 15:46:10 2014 -0700

----------------------------------------------------------------------
 api/src/com/cloud/vm/UserVmService.java              |  3 ---
 .../api/command/admin/vm/ExpungeVMCmd.java           |  2 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java       | 15 ++++-----------
 3 files changed, 5 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25ab05a1/api/src/com/cloud/vm/UserVmService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/UserVmService.java b/api/src/com/cloud/vm/UserVmService.java
index af4e1d3..c0c0335 100755
--- a/api/src/com/cloud/vm/UserVmService.java
+++ b/api/src/com/cloud/vm/UserVmService.java
@@ -21,7 +21,6 @@ import java.util.Map;
 
 import org.apache.cloudstack.api.BaseCmd.HTTPMethod;
 import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
-import org.apache.cloudstack.api.command.admin.vm.ExpungeVMCmd;
 import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd;
 import org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd;
 import org.apache.cloudstack.api.command.user.vm.DeployVMCmd;
@@ -457,8 +456,6 @@ public interface UserVmService {
     UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException,
ManagementServerException,
         VirtualMachineMigrationException;
 
-    UserVm expungeVm(ExpungeVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException;
-
     UserVm expungeVm(long vmId) throws ResourceUnavailableException, ConcurrentOperationException;
 
     /**

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25ab05a1/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java
index 40b9bb8..155fcff 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java
@@ -106,7 +106,7 @@ public class ExpungeVMCmd extends BaseAsyncCmd {
     public void execute() throws ResourceUnavailableException, ConcurrentOperationException
{
         CallContext.current().setEventDetails("Vm Id: " + getId());
         try {
-            UserVm result = _userVmService.expungeVm(this);
+            UserVm result = _userVmService.expungeVm(this.getId());
 
             if (result != null) {
                 SuccessResponse response = new SuccessResponse(getCommandName());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/25ab05a1/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 20306fd..5da1875 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -35,9 +35,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.acl.ControlledEntity.ACLType;
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.affinity.AffinityGroupService;
@@ -47,7 +44,6 @@ import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseCmd.HTTPMethod;
 import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
-import org.apache.cloudstack.api.command.admin.vm.ExpungeVMCmd;
 import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd;
 import org.apache.cloudstack.api.command.user.vm.AddNicToVMCmd;
 import org.apache.cloudstack.api.command.user.vm.DeployVMCmd;
@@ -87,6 +83,8 @@ import org.apache.cloudstack.storage.command.DeleteCommand;
 import org.apache.cloudstack.storage.command.DettachCommand;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -1800,7 +1798,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
                         }
                         for (UserVmVO vm : vms) {
                             try {
-                                expunge(vm, _accountMgr.getSystemUser().getId(), _accountMgr.getSystemAccount());
+                                expungeVm(vm.getId());
                             } catch (Exception e) {
                                 s_logger.warn("Unable to expunge " + vm, e);
                             }
@@ -2091,12 +2089,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
     }
 
     @Override
-    @ActionEvent(eventType = EventTypes.EVENT_VM_EXPUNGE, eventDescription = "expunging Vm",
async = true)
-    public UserVm expungeVm(ExpungeVMCmd cmd) throws ResourceUnavailableException, ConcurrentOperationException
{
-        return expungeVm(cmd.getId());
-    }
-
-    @Override
     @DB
     public InstanceGroupVO createVmGroup(CreateVMGroupCmd cmd) {
         Account caller = CallContext.current().getCallingAccount();
@@ -3596,6 +3588,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
     }
 
     @Override
+    @ActionEvent(eventType = EventTypes.EVENT_VM_EXPUNGE, eventDescription = "expunging Vm",
async = true)
     public UserVm expungeVm(long vmId) throws ResourceUnavailableException, ConcurrentOperationException
{
         Account caller = CallContext.current().getCallingAccount();
         Long userId = caller.getId();


Mime
View raw message