You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/10/27 19:27:38 UTC

[4/7] git commit: updated refs/heads/master to 535ab51

Cloudstack-8816: Fixed missing resource uuid in delete snapshot events

*event before*

| management-server.AsyncJobEvent.complete.Snapshot.*
| cloudstack-events | 26            |
{"cmdInfo":"{\"id\":\"2ebabd8f-0b34-4461-8071-0917c231ca49\",\"response\":\"json\",\"ctxDetails\":\"{\\\"interface
com.cloud.storage.Snapshot\\\":\\\"2ebabd8f-0b34-4461-8071-0917c231ca49\\\"}\",\"cmdEventType\":\"SNAPSHOT.DELETE\",\"ctxUserId\":\"2\",\"httpmethod\":\"GET\",\"_\":\"1444803845320\",\"uuid\":\"2ebabd8f-0b34-4461-8071-0917c231ca49\",\"ctxAccountId\":\"2\",\"ctxStartEventId\":\"1345\"}","instanceType":"Snapshot","jobId":"fab1feaf-3b4f-4158-b332-a78e43fee5e0","status":"SUCCEEDED","processStatus":"0","commandEventType":"SNAPSHOT.DELETE","resultCode":"0","command":"org.apache.cloudstack.api.command.user.snapshot.DeleteSnapshotCmd","jobResult":"org.apache.cloudstack.api.response.SuccessResponse/null/{\"success\":true}","account":"bd73dc2e-35c0-11e5-b094-d4ae52cb9af0","user":"bd7ea748-35c0-11e5-b094-d4ae52cb9af0"}

*After*

|
management-server.AsyncJobEvent.complete.Snapshot.f25ad748-2fe3-4911-b40c-4698425c8a2f
| cloudstack-events | 0             |
{"cmdInfo":"{\"id\":\"f25ad748-2fe3-4911-b40c-4698425c8a2f\",\"response\":\"json\",\"ctxDetails\":\"{\\\"interface
com.cloud.storage.Snapshot\\\":\\\"f25ad748-2fe3-4911-b40c-4698425c8a2f\\\"}\",\"cmdEventType\":\"SNAPSHOT.DELETE\",\"ctxUserId\":\"2\",\"httpmethod\":\"GET\",\"_\":\"1444806612980\",\"uuid\":\"f25ad748-2fe3-4911-b40c-4698425c8a2f\",\"ctxAccountId\":\"2\",\"ctxStartEventId\":\"1388\"}","instanceType":"Snapshot","instanceUuid":"f25ad748-2fe3-4911-b40c-4698425c8a2f","jobId":"69849909-9082-481c-b8ee-9ddc1608fe8d","status":"SUCCEEDED","processStatus":"0","commandEventType":"SNAPSHOT.DELETE","resultCode":"0","command":"org.apache.cloudstack.api.command.user.snapshot.DeleteSnapshotCmd","jobResult":"org.apache.cloudstack.api.response.SuccessResponse/null/{\"success\":true}","account":"bd73dc2e-35c0-11e5-b094-d4ae52cb9af0","user":"bd7ea748-35c0-11e5-b094-d4ae52cb9af0"}
| 886           | string           | True        |


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

Branch: refs/heads/master
Commit: 04554ddd242c4554c8ff47e58cebe00c919f6f32
Parents: 242b87d
Author: Rajani Karuturi <ra...@citrix.com>
Authored: Wed Oct 14 14:28:47 2015 +0530
Committer: Rajani Karuturi <ra...@citrix.com>
Committed: Mon Oct 26 09:15:32 2015 +0530

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiDBUtils.java | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/04554ddd/server/src/com/cloud/api/ApiDBUtils.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java
index 4fc9f42..130fa88 100644
--- a/server/src/com/cloud/api/ApiDBUtils.java
+++ b/server/src/com/cloud/api/ApiDBUtils.java
@@ -1033,12 +1033,7 @@ public class ApiDBUtils {
     }
 
     public static Snapshot findSnapshotById(long snapshotId) {
-        SnapshotVO snapshot = s_snapshotDao.findById(snapshotId);
-        if (snapshot != null && snapshot.getRemoved() == null && snapshot.getState() == Snapshot.State.BackedUp) {
-            return snapshot;
-        } else {
-            return null;
-        }
+        return s_snapshotDao.findByIdIncludingRemoved(snapshotId);
     }
 
     public static StoragePoolVO findStoragePoolById(Long storagePoolId) {