You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/01/18 13:13:15 UTC
git commit: updated refs/heads/4.3 to 2c7cacd
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 <ro...@shapeblue.com>
(cherry picked from commit f6564b0b03362093efd1766a64e34184208eec3c)
Signed-off-by: Rohit Yadav <ro...@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 <ro...@shapeblue.com>
Authored: Sun Jan 18 17:40:37 2015 +0530
Committer: Rohit Yadav <ro...@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());