cloudstack-dev mailing list archives

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

    https://github.com/apache/cloudstack/pull/1578#discussion_r77754965
  
    --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java
---
    @@ -403,4 +455,37 @@ private HostVO getNuageVspHost(long physicalNetworkId) {
             }
             return nuageVspHost;
         }
    +
    +    private boolean networkHasDns(Network network) {
    +
    +        if (network != null) {
    +            List<String> dnsProviders = _ntwkOfferingSrvcDao.listProvidersForServiceForNetworkOffering(network.getNetworkOfferingId(),
Network.Service.Dns);
    +            return dnsProviders.contains(Network.Provider.VirtualRouter.getName())
    +                || dnsProviders.contains(Network.Provider.VPCVirtualRouter.getName());
    +
    +        }
    +
    +        return false;
    +    }
    +
    +    private boolean getDefaultHasDns(Map<Long, Boolean> cache, Nic nic) {
    +        Long networkId = nic.isDefaultNic()
    +                ? Long.valueOf(nic.getNetworkId())
    +                : getDefaultNetwork(nic.getInstanceId());
    +
    +        Boolean hasDns = cache.get(networkId);
    +        if (hasDns == null) {
    +            hasDns = networkHasDns(_networkDao.findById(networkId));
    +            cache.put(networkId, hasDns);
    +        }
    +        return hasDns;
    +    }
    +
    +    private Long getDefaultNetwork(long vmId) {
    +        NicVO defaultNic = _nicDao.findDefaultNicForVM(vmId);
    +        if (defaultNic != null) return defaultNic.getNetworkId();
    --- End diff --
    
    Per our coding standards, please wrap all ``if`` blocks in curly braces.


---
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