Github user DaanHoogland commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1179#discussion_r46761996
  
    --- Diff: server/src/com/cloud/network/element/VpcVirtualRouterElement.java 
---
    @@ -479,48 +482,47 @@ public boolean applyIps(final Network network, final 
List<? extends PublicIpAddr
                     break;
                 }
             }
    +        boolean result = false;
             if (canHandle) {
                 final List<DomainRouterVO> routers = 
_routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
                 if (routers == null || routers.isEmpty()) {
                     s_logger.debug(getName() + " element doesn't need to 
associate ip addresses on the backend; VPC virtual " + "router doesn't exist in 
the network "
                             + network.getId());
    -                return true;
    +                return result;
                 }
     
                 final DataCenterVO dcVO = 
_dcDao.findById(network.getDataCenterId());
                 final NetworkTopology networkTopology = 
networkTopologyContext.retrieveNetworkTopology(dcVO);
     
    -            return networkTopology.associatePublicIP(network, ipAddress, 
routers);
    -        } else {
    -            return false;
    +            for (final DomainRouterVO domainRouterVO : routers) {
    +                result = networkTopology.associatePublicIP(network, 
ipAddress, domainRouterVO);
    +            }
             }
    +        return result;
         }
     
         @Override
         public boolean applyNetworkACLs(final Network network, final List<? 
extends NetworkACLItem> rules) throws ResourceUnavailableException {
    +        boolean result = true;
             if (canHandle(network, Service.NetworkACL)) {
                 final List<DomainRouterVO> routers = 
_routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
                 if (routers == null || routers.isEmpty()) {
                     s_logger.debug("Virtual router elemnt doesn't need to 
apply firewall rules on the backend; virtual " + "router doesn't exist in the 
network " + network.getId());
    -                return true;
    +                return result;
                 }
     
                 final DataCenterVO dcVO = 
_dcDao.findById(network.getDataCenterId());
                 final NetworkTopology networkTopology = 
networkTopologyContext.retrieveNetworkTopology(dcVO);
     
    -            try {
    -                if (!networkTopology.applyNetworkACLs(network, rules, 
routers, false)) {
    -                    return false;
    -                } else {
    -                    return true;
    +            for (final DomainRouterVO domainRouterVO : routers) {
    +                try {
    +                    result = networkTopology.applyNetworkACLs(network, 
rules, domainRouterVO, false);
    --- End diff --
    
    result &=


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to