mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Bug 10560 - Baremetal template created 5 entries when added (edit)
resolved fixed
This commit is contained in:
parent
399e6a673b
commit
38c0772507
@ -437,7 +437,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);
|
||||
}
|
||||
|
||||
@ -256,7 +256,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…
x
Reference in New Issue
Block a user