mirror of https://github.com/apache/cloudstack.git
bug 11924: don't return ISO entries where removed != null
status 11924: resolved fixed reviewed by: Will Chan
This commit is contained in:
parent
516ea0ee0f
commit
b16777994f
|
|
@ -65,7 +65,7 @@ public interface VMTemplateDao extends GenericDao<VMTemplateVO, Long> {
|
|||
public List<VMTemplateVO> listAllInZone(long dataCenterId);
|
||||
|
||||
public List<VMTemplateVO> listByHypervisorType(HypervisorType hyperType);
|
||||
public List<VMTemplateVO> publicIsoSearch(Boolean bootable);
|
||||
public List<VMTemplateVO> publicIsoSearch(Boolean bootable, boolean listRemoved);
|
||||
VMTemplateVO findSystemVMTemplate(long zoneId);
|
||||
VMTemplateVO findSystemVMTemplate(long zoneId, HypervisorType hType);
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<VMTemplateVO> publicIsoSearch(Boolean bootable){
|
||||
public List<VMTemplateVO> publicIsoSearch(Boolean bootable, boolean listRemoved){
|
||||
SearchCriteria<VMTemplateVO> sc = PublicIsoSearch.create();
|
||||
sc.setParameters("public", 1);
|
||||
sc.setParameters("format", "ISO");
|
||||
|
|
@ -141,6 +141,10 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
sc.setParameters("bootable", bootable);
|
||||
}
|
||||
|
||||
if (!listRemoved) {
|
||||
sc.setParameters("removed", (Object)null);
|
||||
}
|
||||
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
|
|
@ -251,6 +255,8 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
PublicIsoSearch.and("format", PublicIsoSearch.entity().getFormat(), SearchCriteria.Op.EQ);
|
||||
PublicIsoSearch.and("type", PublicIsoSearch.entity().getTemplateType(), SearchCriteria.Op.EQ);
|
||||
PublicIsoSearch.and("bootable", PublicIsoSearch.entity().isBootable(), SearchCriteria.Op.EQ);
|
||||
PublicIsoSearch.and("removed", PublicIsoSearch.entity().getRemoved(), SearchCriteria.Op.EQ);
|
||||
|
||||
|
||||
tmpltTypeHyperSearch = createSearchBuilder();
|
||||
tmpltTypeHyperSearch.and("templateType", tmpltTypeHyperSearch.entity().getTemplateType(), SearchCriteria.Op.EQ);
|
||||
|
|
@ -432,7 +438,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
if(isIso && templateZonePairList.size() < (pageSize != null ? pageSize : 500)
|
||||
&& templateFilter != TemplateFilter.community
|
||||
&& !(templateFilter == TemplateFilter.self && !BaseCmd.isRootAdmin(account.getType())) ){ //evaluates to true If root admin and filter=self
|
||||
List<VMTemplateVO> publicIsos = publicIsoSearch(bootable);
|
||||
List<VMTemplateVO> publicIsos = publicIsoSearch(bootable, false);
|
||||
for( int i=0; i < publicIsos.size(); i++){
|
||||
if (keyword != null && publicIsos.get(i).getName().contains(keyword)) {
|
||||
templateZonePairList.add(new Pair<Long,Long>(publicIsos.get(i).getId(), null));
|
||||
|
|
|
|||
Loading…
Reference in New Issue