You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/07/27 14:00:42 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #5242: Add internal cs name to vm during the ingest

DaanHoogland commented on a change in pull request #5242:
URL: https://github.com/apache/cloudstack/pull/5242#discussion_r677478661



##########
File path: server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java
##########
@@ -954,6 +955,11 @@ private UserVm importVirtualMachineInternal(final UnmanagedInstanceTO unmanagedI
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Failed to import VM: %s. %s", unmanagedInstance.getName(), Strings.nullToEmpty(e.getMessage())));
         }
 
+        String internalCSName = instanceName;
+        if(!StringUtils.isEmpty(unmanagedInstance.getInternalCSName()) && !unmanagedInstance.getInternalCSName().equals(instanceName)){
+            internalCSName = unmanagedInstance.getInternalCSName();
+        }
+

Review comment:
       bit less to read like this;
   ```suggestion
           String internalCSName = unmanagedInstance.getInternalCSName();
           if(StringUtils.isEmpty(internalCSName)){
               internalCSName = instanceName;
           }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org