cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmaximus <...@git.apache.org>
Subject [GitHub] cloudstack pull request #1578: CLOUDSTACK-9401 : Support for Internal DNS in...
Date Wed, 07 Sep 2016 13:13:50 GMT
Github user fmaximus commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1578#discussion_r77818579
  
    --- Diff: server/src/com/cloud/network/element/VirtualRouterElement.java ---
    @@ -988,6 +1016,21 @@ public boolean addDhcpEntry(final Network network, final NicProfile
nic, final V
             return result;
         }
     
    +    protected boolean deleteDhcpSupportForSubnet(Network network, Network.Service service)
throws ResourceUnavailableException {
    +        if (canHandle(network, service)) {
    +            final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(),
Role.VIRTUAL_ROUTER);
    +            if (routers == null || routers.size() == 0) {
    +                throw new ResourceUnavailableException("Can't find at least one router!",
DataCenter.class, network.getDataCenterId());
    +            }
    +            try {
    +                return _routerMgr.removeDhcpSupportForSubnet(network, routers);
    +            } catch (final ResourceUnavailableException e) {
    +                s_logger.debug("Router resource unavailable ");
    --- End diff --
    
    Here we moved existing code from removeDhcpSupportForSubnet to a separate method, containing
the service. 
    Another question is, why catch ResourceUnavailableException, if it is also present in
the method's throws clause? It then would be logged by the invoking methods.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message