shwstppr commented on a change in pull request #4895:
URL: https://github.com/apache/cloudstack/pull/4895#discussion_r608473483



##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -4839,6 +4852,11 @@ private Answer migrateVolume(MigrateVolumeCommand cmd) {
         String path = cmd.getVolumePath();
 
         VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext());
+        VmwareHypervisorHost hyperHostInTargetCluster = null;
+        if (cmd.getHostGuidInTargetCluster() != null) {
+            hyperHostInTargetCluster = 
VmwareHelper.getHostMOFromHostName(getServiceContext(), 
cmd.getHostGuidInTargetCluster());
+        }
+        VmwareHypervisorHost targetDSHost = hyperHostInTargetCluster != null ? 
hyperHostInTargetCluster : hyperHost;

Review comment:
       @DaanHoogland both `hyperHostInTargetCluster` and `targetDSHost` are 
used in the method later multiple times. I used two different variables to 
prevent using if..else multiple times.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to