mirror of https://github.com/apache/cloudstack.git
Bug 10560 - Baremetal template created 5 entries when added (edit)
resolved fixed
This commit is contained in:
parent
4a8812af68
commit
3c4671aac5
|
|
@ -433,7 +433,8 @@ public class ApiDBUtils {
|
|||
public static VMTemplateHostVO findTemplateHostRef(long templateId, long zoneId, boolean readyOnly) {
|
||||
VMTemplateVO vmTemplate = findTemplateById(templateId);
|
||||
if (vmTemplate.getHypervisorType() == HypervisorType.BareMetal) {
|
||||
return _templateHostDao.listByTemplateId(templateId).get(0);
|
||||
List<VMTemplateHostVO> res = _templateHostDao.listByTemplateId(templateId);
|
||||
return res.size() == 0 ? null : res.get(0);
|
||||
} else {
|
||||
return _storageMgr.getTemplateHostRef(zoneId, templateId, readyOnly);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ public abstract class TemplateAdapterBase implements TemplateAdapter {
|
|||
profile.getBits(), profile.getAccountId(), profile.getCheckSum(), profile.getDisplayText(),
|
||||
profile.getPasswordEnabled(), profile.getGuestOsId(), profile.getBootable(), profile.getHypervisorType());
|
||||
|
||||
if (zoneId == null) {
|
||||
if (zoneId == null || zoneId == -1) {
|
||||
List<DataCenterVO> dcs = _dcDao.listAllIncludingRemoved();
|
||||
|
||||
for (DataCenterVO dc: dcs) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue