bug 7412 : UpdateTemlate - Adding some fields keeping it consistent with listTemplates

status 7412: resolved fixed
This commit is contained in:
nit 2010-12-03 20:06:16 +05:30
parent b543faeeee
commit 94cb30a745
1 changed files with 11 additions and 0 deletions

View File

@ -1437,8 +1437,19 @@ public class ApiResponseHelper implements ResponseGenerator {
response.setFormat(result.getFormat());
response.setOsTypeId(result.getGuestOSId());
response.setOsTypeName(ApiDBUtils.findGuestOSById(result.getGuestOSId()).getDisplayName());
if(result.getFormat() == ImageFormat.ISO){ // Templates are always bootable
response.setBootable(result.isBootable());
}else{
response.setHypervisor(result.getHypervisorType().toString());// hypervisors are associated with templates
}
// add account ID and name
Account owner = ApiDBUtils.findAccountById(result.getAccountId());
if (owner != null) {
response.setAccount(owner.getAccountName());
response.setDomainId(owner.getDomainId());
response.setDomainName(ApiDBUtils.findDomainById(owner.getDomainId()).getName());
}
response.setObjectName("iso");
return response;