CLOUDSTACK-4454:object_store - Not able to delete secondary storage when

existing snapshots are deleted.
This commit is contained in:
Min Chen 2013-08-22 14:56:42 -07:00
parent 75be7a9ac4
commit 2611ac75c1
1 changed files with 2 additions and 0 deletions

View File

@ -68,6 +68,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();
@ -147,6 +148,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);
}