mirror of https://github.com/apache/cloudstack.git
bug 5892: adding the xs-tools.iso to the list resp by implementing a search based on the xs-tools.iso
status 5892: resolved fixed
This commit is contained in:
parent
a6f7d457aa
commit
516e944d2c
|
|
@ -70,5 +70,6 @@ public interface VMTemplateDao extends GenericDao<VMTemplateVO, Long> {
|
|||
public List<VMTemplateVO> listAllInZone(long dataCenterId);
|
||||
|
||||
public List<VMTemplateVO> listByHypervisorType(HypervisorType hyperType);
|
||||
public List<VMTemplateVO> xenToolsIsoSearch();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
protected SearchBuilder<VMTemplateVO> TmpltsInZoneSearch;
|
||||
private SearchBuilder<VMTemplateVO> PublicSearch;
|
||||
private SearchBuilder<VMTemplateVO> NameAccountIdSearch;
|
||||
|
||||
private SearchBuilder<VMTemplateVO> XenToolsIsoSearch;
|
||||
|
||||
private String routerTmpltName;
|
||||
private String consoleProxyTmpltName;
|
||||
|
||||
|
|
@ -103,6 +104,13 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
return findOneBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VMTemplateVO> xenToolsIsoSearch(){
|
||||
SearchCriteria<VMTemplateVO> sc = XenToolsIsoSearch.create();
|
||||
sc.setParameters("name", "xs-tools.iso");
|
||||
return listBy(sc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VMTemplateVO> listAllRoutingTemplates() {
|
||||
SearchCriteria<VMTemplateVO> sc = tmpltTypeSearch.create();
|
||||
|
|
@ -184,6 +192,8 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
NameAccountIdSearch.and("name", NameAccountIdSearch.entity().getName(), SearchCriteria.Op.EQ);
|
||||
NameAccountIdSearch.and("accountId", NameAccountIdSearch.entity().getAccountId(), SearchCriteria.Op.EQ);
|
||||
|
||||
XenToolsIsoSearch = createSearchBuilder();
|
||||
XenToolsIsoSearch.and("name", XenToolsIsoSearch.entity().getName(), SearchCriteria.Op.EQ);
|
||||
|
||||
tmpltTypeHyperSearch = createSearchBuilder();
|
||||
tmpltTypeHyperSearch.and("templateType", tmpltTypeHyperSearch.entity().getTemplateType(), SearchCriteria.Op.EQ);
|
||||
|
|
@ -287,6 +297,11 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
|
|||
} else {
|
||||
templates.add(tmplt);
|
||||
}
|
||||
}
|
||||
|
||||
if(isIso && (account.getType() == Account.ACCOUNT_TYPE_NORMAL)){
|
||||
List<VMTemplateVO> xenToolsIso = xenToolsIsoSearch();
|
||||
templates.addAll(xenToolsIso);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("Error listing templates", e);
|
||||
|
|
|
|||
Loading…
Reference in New Issue