You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2013/08/23 00:38:40 UTC
[2/8] git commit: updated refs/heads/4.2 to 99564b3
CLOUDSTACK-4454:object_store - Not able to delete secondary storage when
existing snapshots are deleted.
(cherry picked from commit 52f08a4f36c35ac9827a1d253b000bfcd6f9d723)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/63d492d0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/63d492d0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/63d492d0
Branch: refs/heads/4.2
Commit: 63d492d05f48d0fa32405f68825df4776a721531
Parents: 0455f1e
Author: Min Chen <mi...@citrix.com>
Authored: Thu Aug 22 14:56:42 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Thu Aug 22 15:14:02 2013 -0700
----------------------------------------------------------------------
.../cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/63d492d0/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java
index bee3436..c7549ac 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java
@@ -25,7 +25,6 @@ import java.util.Map;
import javax.naming.ConfigurationException;
-import com.cloud.utils.db.SearchCriteria2;
import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event;
@@ -70,6 +69,7 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO
storeSearch = createSearchBuilder();
storeSearch.and("store_id", storeSearch.entity().getDataStoreId(), SearchCriteria.Op.EQ);
storeSearch.and("store_role", storeSearch.entity().getRole(), SearchCriteria.Op.EQ);
+ storeSearch.and("state", storeSearch.entity().getState(), SearchCriteria.Op.NEQ);
storeSearch.done();
destroyedSearch = createSearchBuilder();
@@ -153,6 +153,7 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO
SearchCriteria<SnapshotDataStoreVO> sc = storeSearch.create();
sc.setParameters("store_id", id);
sc.setParameters("store_role", role);
+ sc.setParameters("state", ObjectInDataStoreStateMachine.State.Destroyed);
return listBy(sc);
}