cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csui...@apache.org
Subject [2/2] git commit: updated refs/heads/master to 6d18654
Date Tue, 15 Apr 2014 21:23:40 GMT
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/6d186549
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6d186549
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6d186549

Branch: refs/heads/master
Commit: 6d18654958ef1843de2820e46259e13828b81eb1
Parents: 55f53e1
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:28 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/6d186549/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