You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by gi...@git.apache.org on 2017/10/11 14:48:06 UTC

[GitHub] rafaelweingartner commented on a change in pull request #2293: CLOUDSTACK-10047: DVSwitch fixes and improvements

rafaelweingartner commented on a change in pull request #2293: CLOUDSTACK-10047: DVSwitch fixes and improvements
URL: https://github.com/apache/cloudstack/pull/2293#discussion_r144032228
 
 

 ##########
 File path: server/src/com/cloud/hypervisor/HypervisorGuruBase.java
 ##########
 @@ -138,7 +143,24 @@ protected VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile vmProfile) {
             if(vm.getType() == VirtualMachine.Type.NetScalerVm) {
                 nicProfile.setBroadcastType(BroadcastDomainType.Native);
             }
-            nics[i++] = toNicTO(nicProfile);
+            NicTO nicTo = toNicTO(nicProfile);
+            final NetworkVO network = _networkDao.findByUuid(nicTo.getNetworkUuid());
+            if (network != null) {
+                final Map<NetworkOffering.Detail, String> details = networkOfferingDetailsDao.getNtwkOffDetails(network.getNetworkOfferingId());
+                if (details != null) {
 
 Review comment:
   What about reducing the cyclomatic complexicity here?
   it is a matter of inverting the conditional. Instead of `if (true){doSomething}`, we can do `if(!false){continue} doSomething`
   This would enable to remove one if inception
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services