You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2015/04/16 14:42:44 UTC

[1/2] git commit: updated refs/heads/volume-upload to 4f35d36

Repository: cloudstack
Updated Branches:
  refs/heads/volume-upload 4338bea07 -> 4f35d3611


volume upload: added state transition for a failed volume delete


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

Branch: refs/heads/volume-upload
Commit: d5bb2f16fc59876f1a2aa99bc049d322ee794ea8
Parents: 4338bea
Author: Rajani Karuturi <ra...@gmail.com>
Authored: Thu Apr 16 17:32:33 2015 +0530
Committer: Rajani Karuturi <ra...@gmail.com>
Committed: Thu Apr 16 17:42:18 2015 +0530

----------------------------------------------------------------------
 api/src/com/cloud/storage/Volume.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d5bb2f16/api/src/com/cloud/storage/Volume.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/Volume.java b/api/src/com/cloud/storage/Volume.java
index 106e4c2..b7a5eeb 100755
--- a/api/src/com/cloud/storage/Volume.java
+++ b/api/src/com/cloud/storage/Volume.java
@@ -98,6 +98,7 @@ public interface Volume extends ControlledEntity, Identity, InternalIdentity, Ba
             s_fsm.addTransition(new StateMachine2.Transition<State, Event>(Migrating, Event.OperationSucceeded, Ready, null));
             s_fsm.addTransition(new StateMachine2.Transition<State, Event>(Migrating, Event.OperationFailed, Ready, null));
             s_fsm.addTransition(new StateMachine2.Transition<State, Event>(Destroy, Event.OperationSucceeded, Destroy, Arrays.asList(new StateMachine2.Transition.Impact[]{StateMachine2.Transition.Impact.USAGE})));
+            s_fsm.addTransition(new StateMachine2.Transition<State, Event>(Destroy, Event.OperationFailed, Destroy, Arrays.asList(StateMachine2.Transition.Impact.USAGE)));
             s_fsm.addTransition(new StateMachine2.Transition<State, Event>(UploadOp, Event.OperationSucceeded, Uploaded, null));
             s_fsm.addTransition(new StateMachine2.Transition<State, Event>(UploadOp, Event.OperationFailed, Allocated, null));
             s_fsm.addTransition(new StateMachine2.Transition<State, Event>(Uploaded, Event.DestroyRequested, Destroy, null));


[2/2] git commit: updated refs/heads/volume-upload to 4f35d36

Posted by ra...@apache.org.
volume upload: fixed the error message incase of wrong image format


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

Branch: refs/heads/volume-upload
Commit: 4f35d3611a60c64a252f7ce2e233f228101774d0
Parents: d5bb2f1
Author: Rajani Karuturi <ra...@gmail.com>
Authored: Thu Apr 16 17:34:29 2015 +0530
Committer: Rajani Karuturi <ra...@gmail.com>
Committed: Thu Apr 16 17:43:46 2015 +0530

----------------------------------------------------------------------
 server/src/com/cloud/storage/VolumeApiServiceImpl.java | 8 +++++---
 server/src/com/cloud/template/TemplateAdapterBase.java | 9 ++++++---
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4f35d361/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 533f6fa..2022dde 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -385,9 +385,11 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
             _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.secondary_storage);
         }
 
-        ImageFormat imgfmt = ImageFormat.valueOf(format.toUpperCase());
-        if (imgfmt == null) {
-            throw new IllegalArgumentException("Image format is incorrect " + format + ". Supported formats are " + EnumUtils.listValues(ImageFormat.values()));
+        try {
+            ImageFormat.valueOf(format.toUpperCase());
+        } catch (IllegalArgumentException e) {
+            s_logger.debug("ImageFormat IllegalArgumentException: " + e.getMessage());
+            throw new IllegalArgumentException("Image format: " + format + " is incorrect. Supported formats are " + EnumUtils.listValues(ImageFormat.values()));
         }
 
         // Check that the the disk offering specified is valid

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4f35d361/server/src/com/cloud/template/TemplateAdapterBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateAdapterBase.java b/server/src/com/cloud/template/TemplateAdapterBase.java
index 8bb93dd..c5d0c5b 100755
--- a/server/src/com/cloud/template/TemplateAdapterBase.java
+++ b/server/src/com/cloud/template/TemplateAdapterBase.java
@@ -198,9 +198,12 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
             featured = Boolean.FALSE;
         }
 
-        ImageFormat imgfmt = ImageFormat.valueOf(format.toUpperCase());
-        if (imgfmt == null) {
-            throw new IllegalArgumentException("Image format is incorrect " + format + ". Supported formats are " + EnumUtils.listValues(ImageFormat.values()));
+        ImageFormat imgfmt;
+        try {
+            imgfmt = ImageFormat.valueOf(format.toUpperCase());
+        } catch (IllegalArgumentException e) {
+            s_logger.debug("ImageFormat IllegalArgumentException: " + e.getMessage());
+            throw new IllegalArgumentException("Image format: " + format + " is incorrect. Supported formats are " + EnumUtils.listValues(ImageFormat.values()));
         }
 
         // Check that the resource limit for templates/ISOs won't be exceeded