Add support for default dns for subnet
This change allows a configurable default dns server list which will be pre-populated within the subnet creation screen. Change-Id: I89f3813ec6a5a05b575ea1bc775a861f2d2f1e59 Closes-bug: #1504680
This commit is contained in:
parent
5347015c5e
commit
7b49a2c1bd
@ -1333,6 +1333,18 @@ a later release. If there exists a default Subnet Pool it will be automatically
|
||||
detected through the Neutron API and the label will be set to the name of the
|
||||
default Subnet Pool.
|
||||
|
||||
``default_dns_nameservers``:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. versionadded:: 10.0.0(Newton)
|
||||
|
||||
Default: ``None`` (Empty)
|
||||
|
||||
Default DNS servers you would like to use when a subnet is created. This is
|
||||
only a default. Users can still choose a different list of dns servers.
|
||||
|
||||
Example: ``["8.8.8.8", "8.8.4.4", "208.67.222.222"]``
|
||||
|
||||
``OPENSTACK_SSL_CACERT``
|
||||
------------------------
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
"""
|
||||
Views for managing Neutron Subnets.
|
||||
"""
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
@ -48,10 +49,17 @@ class CreateView(workflows.WorkflowView):
|
||||
msg = _("Unable to retrieve network.")
|
||||
exceptions.handle(self.request, msg, redirect=redirect)
|
||||
|
||||
def get_default_dns_servers(self):
|
||||
# this returns the default dns servers to be used for new subnets
|
||||
dns_default = "\n".join(getattr(settings, 'OPENSTACK_NEUTRON_NETWORK',
|
||||
{}).get('default_dns_nameservers', ''))
|
||||
return dns_default
|
||||
|
||||
def get_initial(self):
|
||||
network = self.get_object()
|
||||
return {"network_id": self.kwargs['network_id'],
|
||||
"network_name": network.name_or_id}
|
||||
"network_name": network.name_or_id,
|
||||
"dns_nameservers": self.get_default_dns_servers()}
|
||||
|
||||
|
||||
class UpdateView(workflows.WorkflowView):
|
||||
|
@ -271,6 +271,13 @@ OPENSTACK_NEUTRON_NETWORK = {
|
||||
'enable_vpn': True,
|
||||
'enable_fip_topology_check': True,
|
||||
|
||||
# Default dns servers you would like to use when a subnet is
|
||||
# created. This is only a default, users can still choose a different
|
||||
# list of dns servers when creating a new subnet.
|
||||
# The entries below are examples only, and are not appropriate for
|
||||
# real deployments
|
||||
# 'default_dns_nameservers': ["8.8.8.8", "8.8.4.4", "208.67.222.222"],
|
||||
|
||||
# Neutron can be configured with a default Subnet Pool to be used for IPv4
|
||||
# subnet-allocation. Specify the label you wish to display in the Address
|
||||
# pool selector on the create subnet step if you want to use this feature.
|
||||
|
Loading…
x
Reference in New Issue
Block a user