You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2024/06/14 06:45:05 UTC

(cloudstack) branch 4.19 updated: server: remove username required condition for listVmsForImport (#9124)

This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.19 by this push:
     new df5c5465594 server: remove username required condition for listVmsForImport (#9124)
df5c5465594 is described below

commit df5c5465594a42a7b1430518035e18011367097c
Author: Abhishek Kumar <ab...@gmail.com>
AuthorDate: Fri Jun 14 12:14:59 2024 +0530

    server: remove username required condition for listVmsForImport (#9124)
    
    * server: remove username required condition for listVmsForImport
    
    Fixes #8414
    
    Signed-off-by: Abhishek Kumar <ab...@gmail.com>
    
    * fix
    
    Signed-off-by: Abhishek Kumar <ab...@gmail.com>
    
    * revert
    
    Signed-off-by: Abhishek Kumar <ab...@gmail.com>
    
    ---------
    
    Signed-off-by: Abhishek Kumar <ab...@gmail.com>
---
 .../main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java b/server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java
index 2a177b2b042..ed4f377a896 100644
--- a/server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java
+++ b/server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java
@@ -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));
         }