Merge "NSX|V: add configuration variable for dns_search_domain"

This commit is contained in:
Jenkins 2016-12-14 19:46:14 +00:00 committed by Gerrit Code Review
commit 827ac24ea8
3 changed files with 22 additions and 6 deletions

View File

@ -0,0 +1,9 @@
---
prelude: >
Enable an admin to configure a global search domain.
This is used if no search domain is configured on a
subnet.
features:
- A new configuration variable in the nsxv section will
enable the admin to configure a search domain. The new
variable is dns_search_domain.

View File

@ -580,6 +580,9 @@ nsxv_opts = [
"exclusive_router_appliance_size will be picked up if "
"--router-size parameter is not specified while doing "
"neutron router-create")),
cfg.StrOpt('dns_search_domain',
help=_("(Optional) Use this search domain if there is no "
"search domain configured on the subnet.")),
cfg.ListOpt('nameservers',
default=[],
help=_('List of nameservers to configure for the DHCP binding '

View File

@ -912,12 +912,16 @@ class EdgeManager(object):
sub_binding = nsxv_db.get_nsxv_subnet_ext_attributes(
context.session,
subnet_id)
if sub_binding:
if sub_binding.dns_search_domain is not None:
static_config['domainName'] = sub_binding.dns_search_domain
if sub_binding.dhcp_mtu:
static_config = self.add_mtu_on_static_binding(
static_config, sub_binding.dhcp_mtu)
dns_search_domain = None
if sub_binding and sub_binding.dns_search_domain:
dns_search_domain = sub_binding.dns_search_domain
elif cfg.CONF.nsxv.dns_search_domain:
dns_search_domain = cfg.CONF.nsxv.dns_search_domain
if dns_search_domain:
static_config['domainName'] = dns_search_domain
if sub_binding and sub_binding.dhcp_mtu:
static_config = self.add_mtu_on_static_binding(
static_config, sub_binding.dhcp_mtu)
self.handle_meta_static_route(
context, subnet_id, [static_config])