cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.4 to 668541d
Date Sun, 18 Jan 2015 12:13:30 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 ea3fb82f8 -> 668541d6b


CLOUDSTACK-8167: publish volume uuid on event bus in create snapshot cmd

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit f6564b0b03362093efd1766a64e34184208eec3c)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.4
Commit: 668541d6b6d23fdfed4e81729e66efb3374bba38
Parents: ea3fb82
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Sun Jan 18 17:40:37 2015 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Sun Jan 18 17:43:21 2015 +0530

----------------------------------------------------------------------
 .../api/command/user/snapshot/CreateSnapshotCmd.java    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/668541d6/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
index df7fe82..7bba620 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
@@ -100,6 +100,14 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
         return volumeId;
     }
 
+    public String getVolumeUuid() {
+        Volume volume = (Volume)this._entityMgr.findById(Volume.class, getVolumeId());
+        if (volume == null) {
+            throw new InvalidParameterValueException("Unable to find volume's UUID");
+        }
+        return volume.getUuid();
+    }
+
     public Long getPolicyId() {
         if (policyId != null) {
             return policyId;
@@ -159,7 +167,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
 
     @Override
     public String getEventDescription() {
-        return "creating snapshot for volume: " + getVolumeId();
+        return "creating snapshot for volume: " + getVolumeUuid();
     }
 
     @Override
@@ -181,7 +189,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
     @Override
     public void execute() {
         s_logger.info("VOLSS: createSnapshotCmd starts:" + System.currentTimeMillis());
-        CallContext.current().setEventDetails("Volume Id: " + getVolumeId());
+        CallContext.current().setEventDetails("Volume Id: " + getVolumeUuid());
         Snapshot snapshot;
         try {
             snapshot =


Mime
View raw message