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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]