[
https://issues.apache.org/jira/browse/CLOUDSTACK-9401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15469372#comment-15469372
]
ASF GitHub Bot commented on CLOUDSTACK-9401:
--------------------------------------------
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.
> Nuage VSP Plugin : Support for InternalDns including Marvin test coverage
> -------------------------------------------------------------------------
>
> Key: CLOUDSTACK-9401
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9401
> Project: CloudStack
> Issue Type: Task
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Automation, Network Controller
> Reporter: Rahul Singal
> Assignee: Nick Livens
>
> Supporting Internal Dns by using Dns service provider as Virtual Router but
> Dhcp provider will be NuageVsp. The idea is here is to keep using Internal
> Dns service of cloudstack when network provider is some other vendor.
> A sample network offering will be like below one:-
> Service Provider
> DHCP NuageVsp
> DNS VirtualRouter/VpcVirtualRouter
> UserData VirtualRouter/VpcVirtualRouter
> Virtual Networking NuageVsp
> SourceNat NuageVsp
> StaticNat NuageVsp
> NetworkAcl/Firewall NuageVsp
> Testrun:-
> Verify InternalDns on Isolated Network ... === TestName:
> test_01_Isolated_Network_with_zone | Status : SUCCESS ===
> ok
> Verify InternalDns on Isolated Network with ping by hostname ... ===
> TestName: test_02_Isolated_Network | Status : SUCCESS ===
> ok
> Verify update NetworkDomain for InternalDns on Isolated Network ... ===
> TestName: test_03_Update_Network_with_Domain | Status : SUCCESS ===
> ok
> Verify update NetworkDomain for InternalDns on Isolated Network with ping VM
> ... === TestName: test_04_Update_Network_with_Domain | Status : SUCCESS ===
> ok
> Verify InternalDns on VPC Network ... === TestName:
> test_05_VPC_Network_With_InternalDns | Status : SUCCESS ===
> ok
> Verify InternalDns on VPC Network by ping with hostname ... === TestName:
> test_06_VPC_Network_With_InternalDns | Status : SUCCESS ===
> ok
> ----------------------------------------------------------------------
> Ran 6 tests in 5736.562s
> OK
> cloudstack$ pep8 --max-line-length=150 test_internal_dns.py
> cloudstack$ pyflakes test_internal_dns.py
> cloudstack$
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)