cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csui...@apache.org
Subject [1/2] git commit: updated refs/heads/4.4 to 47208dc
Date Tue, 15 Apr 2014 21:23:39 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 46f6b26d4 -> 47208dc23
  refs/heads/master 55f53e13e -> 6d1865495


CLOUDSTACK-6422: Fixed errors with simulator VM snapshot delete and revert


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

Branch: refs/heads/4.4
Commit: 47208dc23d4ee68db758889cd9e60e58aca1b72f
Parents: 46f6b26
Author: Chris Suich <csuich2@gmail.com>
Authored: Thu Apr 10 22:28:57 2014 -0400
Committer: Chris Suich <csuich2@gmail.com>
Committed: Tue Apr 15 17:23:21 2014 -0400

----------------------------------------------------------------------
 .../src/com/cloud/agent/manager/MockVmManagerImpl.java      | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/47208dc2/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
index f487eb4..e0a7e62 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockVmManagerImpl.java
@@ -485,22 +485,23 @@ public class MockVmManagerImpl extends ManagerBase implements MockVmManager
{
     public Answer deleteVmSnapshot(DeleteVMSnapshotCommand cmd) {
         String vm = cmd.getVmName();
         String snapshotName = cmd.getTarget().getSnapshotName();
-        if (_mockVmDao.findByVmName(cmd.getVmName()) != null) {
+        if (_mockVmDao.findByVmName(cmd.getVmName()) == null) {
             return new DeleteVMSnapshotAnswer(cmd, false, "No VM by name " + cmd.getVmName());
         }
         s_logger.debug("Removed snapshot " + snapshotName + " of VM " + vm);
-        return new DeleteVMSnapshotAnswer(cmd, true, "success");
+        return new DeleteVMSnapshotAnswer(cmd, cmd.getVolumeTOs());
     }
 
     @Override
     public Answer revertVmSnapshot(RevertToVMSnapshotCommand cmd) {
         String vm = cmd.getVmName();
         String snapshot = cmd.getTarget().getSnapshotName();
-        if (_mockVmDao.findByVmName(cmd.getVmName()) != null) {
+        MockVMVO vmVo = _mockVmDao.findByVmName(cmd.getVmName());
+        if (vmVo == null) {
             return new RevertToVMSnapshotAnswer(cmd, false, "No VM by name " + cmd.getVmName());
         }
         s_logger.debug("Reverted to snapshot " + snapshot + " of VM " + vm);
-        return new RevertToVMSnapshotAnswer(cmd, true, "success");
+        return new RevertToVMSnapshotAnswer(cmd, cmd.getVolumeTOs(), vmVo.getState());
     }
 
     @Override


Mime
View raw message