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.3 to 2c7cacd
Date Sun, 18 Jan 2015 12:13:15 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3 dc97372d6 -> 2c7cacd9d


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>

Conflicts:
	api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java


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

Branch: refs/heads/4.3
Commit: 2c7cacd9df97027b8f1de100397fc489590f43b2
Parents: dc97372
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:02 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/2c7cacd9/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 fc40fb2..8437710 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
@@ -94,6 +94,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;
@@ -153,7 +161,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
 
     @Override
     public String getEventDescription() {
-        return "creating snapshot for volume: " + getVolumeId();
+        return "creating snapshot for volume: " + getVolumeUuid();
     }
 
     @Override
@@ -175,7 +183,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 = _volumeService.takeSnapshot(this.getVolumeId(), this.getPolicyId(),
this.getEntityId(), _accountService.getAccount(getEntityOwnerId()), getQuiescevm());


Mime
View raw message