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 2019/07/18 08:38:20 UTC

[GitHub] [cloudstack] server24 commented on a change in pull request #3501: Fix stop VM issue on basic zones

server24 commented on a change in pull request #3501: Fix stop VM issue on basic zones
URL: https://github.com/apache/cloudstack/pull/3501#discussion_r304799135
 
 

 ##########
 File path: server/src/main/java/org/apache/cloudstack/network/topology/BasicNetworkVisitor.java
 ##########
 @@ -198,7 +198,7 @@ public boolean visit(final DhcpEntryRules dhcp) throws ResourceUnavailableExcept
         final DeployDestination destination = dhcp.getDestination();
         final boolean remove = dhcp.isRemove();
 
-        if (router.getPodIdToDeployIn().longValue() == destination.getPod().getId()) {
+        if (destination != null && router.getPodIdToDeployIn().longValue() == destination.getPod().getId()) {
 
 Review comment:
   @anuragaw @nvazquez 
   This would avoid the command being executed at all, which is not the original intention. The destination is not necessary when removing something, as the DhcpRule in this case should already be deployed. So wouldn't it make more sense to change the if to:
   
   ```
   if (router != null &&
               (remove || (destination != null &&
                                       destination.getPod() != null && router.getPodIdToDeployIn() != null &&
                                       router.getPodIdToDeployIn().longValue() == destination.getPod().getId()))) {
   ```

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


With regards,
Apache Git Services