bug CS-14644: Added IdentityProxy to get UUID for unable to use template error in deployVm API

This commit is contained in:
kishan 2012-08-09 13:23:53 +05:30
parent fd7b1e757f
commit e77c17990f
1 changed files with 4 additions and 1 deletions

View File

@ -46,6 +46,7 @@ import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.uservm.UserVm;
import com.cloud.utils.IdentityProxy;
@Implementation(description="Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.", responseObject=UserVmResponse.class)
public class DeployVMCmd extends BaseAsyncCreateCmd {
@ -369,7 +370,9 @@ public class DeployVMCmd extends BaseAsyncCreateCmd {
VirtualMachineTemplate template = _templateService.getTemplate(templateId);
// Make sure a valid template ID was specified
if (template == null) {
throw new InvalidParameterValueException("Unable to use template " + templateId, null);
List<IdentityProxy> idList = new ArrayList<IdentityProxy>();
idList.add(new IdentityProxy("vm_template", templateId, "templateId"));
throw new InvalidParameterValueException("Unable to use template ", idList);
}
DiskOffering diskOffering = null;