Fixed invalid ostypeid when not using deployasis (#5033)

This commit is contained in:
Spaceman1984 2021-05-21 11:45:24 +02:00 committed by GitHub
parent 5f734f718e
commit 5cbc1d9b18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -183,7 +183,7 @@ public class GetUploadParamsForTemplateCmd extends AbstractGetUploadParamsCmd {
if (!hypervisor.equalsIgnoreCase(Hypervisor.HypervisorType.VMware.toString()) && osTypeId == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Missing parameter ostypeid");
}
if (hypervisor.equalsIgnoreCase(Hypervisor.HypervisorType.VMware.toString()) && osTypeId != null) {
if (hypervisor.equalsIgnoreCase(Hypervisor.HypervisorType.VMware.toString()) && deployAsIs && osTypeId != null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid parameter ostypeid, not applicable for VMware");
}
}