rafaelweingartner commented on a change in pull request #2672: 
CLOUDSTACK-10377: Fix Network restart for Nuage
URL: https://github.com/apache/cloudstack/pull/2672#discussion_r190858353
 
 

 ##########
 File path: 
plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
 ##########
 @@ -528,29 +533,35 @@ public void reserve(NicProfile nic, Network network, 
VirtualMachineProfile vm, D
             nic.setBroadcastUri(network.getBroadcastUri());
             nic.setIsolationUri(network.getBroadcastUri());
 
-            //NicProfile does not contain the NIC UUID. We need this 
information to set it in the VMInterface and VPort
-            //that we create in VSP
-            NicVO nicFromDb = _nicDao.findById(nic.getId());
-            IPAddressVO staticNatIp = 
_ipAddressDao.findByVmIdAndNetworkId(network.getId(), vm.getId());
             VspVm vspVm = 
_nuageVspEntityBuilder.buildVspVm(vm.getVirtualMachine(), network);
-            VspNic vspNic = 
_nuageVspEntityBuilder.buildVspNic(nicFromDb.getUuid(), nic);
-            VspStaticNat vspStaticNat = null;
-            if (staticNatIp != null) {
-                VlanVO staticNatVlan = 
_vlanDao.findById(staticNatIp.getVlanId());
-                vspStaticNat = _nuageVspEntityBuilder.buildVspStaticNat(null, 
staticNatIp, staticNatVlan, vspNic);
-            }
 
-            boolean defaultHasDns = getDefaultHasDns(networkHasDnsCache, 
nicFromDb);
-            VspDhcpVMOption dhcpOption = 
_nuageVspEntityBuilder.buildVmDhcpOption(nicFromDb, defaultHasDns, 
networkHasDns);
-            ReserveVmInterfaceVspCommand cmd = new 
ReserveVmInterfaceVspCommand(vspNetwork, vspVm, vspNic, vspStaticNat, 
dhcpOption);
-            Answer answer = _agentMgr.easySend(nuageVspHost.getId(), cmd);
+            if 
(!Boolean.TRUE.equals(vm.getParameter(VirtualMachineProfile.Param.RollingRestart)))
 {
 
 Review comment:
   Would you mind extracting these blocks of code to specific methods and unit 
testing them? Some documentation might help as well. 
   
   This is a comment to for this PR only: We really need to change our mind set 
and start using smaller, concise, well-documented and unit-tested methods. This 
in turn can greatly improve our productivity.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to