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:12:31 UTC
git commit: updated refs/heads/master to cecab95
Repository: cloudstack
Updated Branches:
refs/heads/master d9bd235bf -> cecab95cc
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/cecab95c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cecab95c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cecab95c
Branch: refs/heads/master
Commit: cecab95cc9184ae4b4fcf7a1615f5a1e428912e6
Parents: d9bd235
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:42:11 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/cecab95c/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 4737305..306ab5f 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
@@ -107,6 +107,14 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
return snapshotName;
}
+ 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;
@@ -166,7 +174,7 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd {
@Override
public String getEventDescription() {
- return "creating snapshot for volume: " + getVolumeId();
+ return "creating snapshot for volume: " + getVolumeUuid();
}
@Override
@@ -188,7 +196,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 =