cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject git commit: updated refs/heads/volume-upload to 4338bea
Date Tue, 14 Apr 2015 10:41:28 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/volume-upload 5c152e5f3 -> 4338bea07


volume upload: cannot delete a volume in NotUploaded state
Volume deletion is not allowed in NotUploaded or UploadInProgress states, added validation
in delete volume API for same


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

Branch: refs/heads/volume-upload
Commit: 4338bea07003e7bcdd5a9565f1b203708f75b11f
Parents: 5c152e5
Author: Koushik Das <koushik@apache.org>
Authored: Tue Apr 14 16:08:54 2015 +0530
Committer: Koushik Das <koushik@apache.org>
Committed: Tue Apr 14 16:08:54 2015 +0530

----------------------------------------------------------------------
 server/src/com/cloud/storage/VolumeApiServiceImpl.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4338bea0/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index 4ff7686..533f6fa 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -1169,11 +1169,11 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
 
         VolumeVO volume = _volsDao.findById(volumeId);
         if (volume == null) {
-            throw new InvalidParameterValueException("Unable to aquire volume with ID: "
+ volumeId);
+            throw new InvalidParameterValueException("Unable to find volume with ID: " +
volumeId);
         }
 
         if (!_snapshotMgr.canOperateOnVolume(volume)) {
-            throw new InvalidParameterValueException("There are snapshot creating on it,
Unable to delete the volume");
+            throw new InvalidParameterValueException("There are snapshot operations in progress
on the volume, unable to delete it");
         }
 
         _accountMgr.checkAccess(caller, null, true, volume);
@@ -1189,6 +1189,10 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             }
         }
 
+        if (volume.getState() == Volume.State.NotUploaded || volume.getState() == Volume.State.UploadInProgress)
{
+            throw new InvalidParameterValueException("The volume is either getting uploaded
or it may be initiated shortly, please wait for it to be completed");
+        }
+
         try {
             if (volume.getState() != Volume.State.Destroy && volume.getState() !=
Volume.State.Expunging && volume.getState() != Volume.State.Expunging) {
                 Long instanceId = volume.getInstanceId();


Mime
View raw message