rhtyd closed pull request #2312: CLOUDSTACK-7793 Create Snaphot with quiesce 
option set to true fails ?
URL: https://github.com/apache/cloudstack/pull/2312
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java 
b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
index a84db084f21..bd42faca658 100644
--- a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
+++ b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
@@ -18,6 +18,7 @@
 package com.cloud.vm.snapshot;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -603,9 +604,10 @@ private boolean orchestrateDeleteVMSnapshot(Long 
vmSnapshotId) {
 
         _accountMgr.checkAccess(caller, null, true, vmSnapshot);
 
-        // check VM snapshot states, only allow to delete vm snapshots in 
created and error state
-        if (VMSnapshot.State.Ready != vmSnapshot.getState() && 
VMSnapshot.State.Expunging != vmSnapshot.getState() && VMSnapshot.State.Error 
!= vmSnapshot.getState()) {
-            throw new InvalidParameterValueException("Can't delete the vm 
snapshotshot " + vmSnapshotId + " due to it is not in Created or Error, or 
Expunging State");
+        List<VMSnapshot.State> validStates = 
Arrays.asList(VMSnapshot.State.Ready, VMSnapshot.State.Expunging, 
VMSnapshot.State.Error, VMSnapshot.State.Allocated);
+        // check VM snapshot states, only allow to delete vm snapshots in 
ready, expunging, allocated and error state
+        if (!validStates.contains(vmSnapshot.getState())) {
+            throw new InvalidParameterValueException("Can't delete the vm 
snapshot " + vmSnapshotId + " due to it is not in " + validStates.toString()  + 
"States");
         }
 
         // check if there are other active VM snapshot tasks


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to