Github user jburwell commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1578#discussion_r77755589
--- Diff: server/src/com/cloud/network/element/VirtualRouterElement.java ---
@@ -922,10 +921,56 @@ public boolean release(final Network network, final
NicProfile nic, final Virtua
return true;
}
+
@Override
public boolean configDhcpSupportForSubnet(final Network network, final
NicProfile nic, final VirtualMachineProfile vm, final DeployDestination dest,
- final ReservationContext context) throws
ConcurrentOperationException, InsufficientCapacityException,
ResourceUnavailableException {
- if (canHandle(network, Service.Dhcp)) {
+ final ReservationContext
context) throws ConcurrentOperationException, InsufficientCapacityException,
ResourceUnavailableException {
+ return configureDhcpSupport(network, nic, vm, dest,
Service.Dhcp);
+ }
+
+ @Override
+ public boolean configDnsSupportForSubnet(Network network, NicProfile
nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext
context) throws ConcurrentOperationException, InsufficientCapacityException,
ResourceUnavailableException {
+ // Ignore if virtual router is already dhcp provider
+ if
(_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp,
getProvider())) {
+ return true;
+ } else {
+ return configureDhcpSupport(network, nic, vm, dest,
Service.Dns);
+ }
+ }
+
+ @Override
+ public boolean removeDhcpSupportForSubnet(final Network network)
throws ResourceUnavailableException {
+ return deleteDhcpSupportForSubnet(network, Service.Dhcp);
+ }
+
+ @Override
+ public boolean removeDnsSupportForSubnet(Network network) throws
ResourceUnavailableException {
+ // Ignore if virtual router is already dhcp provider
+ if
(_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp,
getProvider())) {
+ return true;
+ } else {
--- End diff --
This ``else`` block is unnecessary since the ``if`` block returns. Please
remove it.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---