Skip to content

Commit df5c546

Browse files
authored
server: remove username required condition for listVmsForImport (apache#9124)
* server: remove username required condition for listVmsForImport Fixes apache#8414 Signed-off-by: Abhishek Kumar <[email protected]> * fix Signed-off-by: Abhishek Kumar <[email protected]> * revert Signed-off-by: Abhishek Kumar <[email protected]> --------- Signed-off-by: Abhishek Kumar <[email protected]>
1 parent 6ce2a58 commit df5c546

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,11 +2446,7 @@ public ListResponse<UnmanagedInstanceResponse> listVmsForImport(ListVmsForImport
24462446
throw new InvalidParameterValueException("Please specify a valid zone.");
24472447
}
24482448
final String hypervisorType = cmd.getHypervisor();
2449-
if (Hypervisor.HypervisorType.KVM.toString().equalsIgnoreCase(hypervisorType)) {
2450-
if (StringUtils.isBlank(cmd.getUsername())) {
2451-
throw new InvalidParameterValueException("Username need to be provided.");
2452-
}
2453-
} else {
2449+
if (!Hypervisor.HypervisorType.KVM.toString().equalsIgnoreCase(hypervisorType)) {
24542450
throw new InvalidParameterValueException(String.format("VM Import is currently not supported for hypervisor: %s", hypervisorType));
24552451
}
24562452

0 commit comments

Comments
 (0)