server: remove username required condition for listVmsForImport (#9124)

* server: remove username required condition for listVmsForImport

Fixes #8414

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* fix

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

* revert

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

---------

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2024-06-14 12:14:59 +05:30 committed by GitHub
parent 6ce2a58f9b
commit df5c546559
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 5 deletions

View File

@ -2446,11 +2446,7 @@ public class UnmanagedVMsManagerImpl implements UnmanagedVMsManager {
throw new InvalidParameterValueException("Please specify a valid zone.");
}
final String hypervisorType = cmd.getHypervisor();
if (Hypervisor.HypervisorType.KVM.toString().equalsIgnoreCase(hypervisorType)) {
if (StringUtils.isBlank(cmd.getUsername())) {
throw new InvalidParameterValueException("Username need to be provided.");
}
} else {
if (!Hypervisor.HypervisorType.KVM.toString().equalsIgnoreCase(hypervisorType)) {
throw new InvalidParameterValueException(String.format("VM Import is currently not supported for hypervisor: %s", hypervisorType));
}