mirror of https://github.com/apache/cloudstack.git
bug 10687: respect "bootable" parameter when listIso
status 10687: resolved fixed
This commit is contained in:
parent
50dce6d5a0
commit
738811305b
|
|
@ -66,7 +66,7 @@ public interface VMTemplateDao extends GenericDao<VMTemplateVO, Long> {
|
|||
public List<VMTemplateVO> listAllInZone(long dataCenterId);
|
||||
|
||||
public List<VMTemplateVO> listByHypervisorType(HypervisorType hyperType);
|
||||
public List<VMTemplateVO> publicIsoSearch();
|
||||
public List<VMTemplateVO> publicIsoSearch(Boolean bootable);
|
||||
VMTemplateVO findSystemVMTemplate(long zoneId);
|
||||
VMTemplateVO findSystemVMTemplate(long zoneId, HypervisorType hType);
|
||||
|
||||
|
|
|
|||
|
|
@ -138,11 +138,15 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<VMTemplateVO> publicIsoSearch(){
|
||||
public List<VMTemplateVO> publicIsoSearch(Boolean bootable){
|
||||
SearchCriteria<VMTemplateVO> sc = PublicIsoSearch.create();
|
||||
sc.setParameters("public", 1);
|
||||
sc.setParameters("format", "ISO");
|
||||
sc.setParameters("type", TemplateType.PERHOST.toString());
|
||||
if (bootable != null) {
|
||||
sc.setParameters("bootable", bootable);
|
||||
}
|
||||
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
|
|
@ -252,6 +256,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
PublicIsoSearch.and("public", PublicIsoSearch.entity().isPublicTemplate(), SearchCriteria.Op.EQ);
|
||||
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);
|
||||
|
||||
tmpltTypeHyperSearch = createSearchBuilder();
|
||||
tmpltTypeHyperSearch.and("templateType", tmpltTypeHyperSearch.entity().getTemplateType(), SearchCriteria.Op.EQ);
|
||||
|
|
@ -433,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();
|
||||
List<VMTemplateVO> publicIsos = publicIsoSearch(bootable);
|
||||
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