Merge "NSX|V: add ability for admin to configure default nameservers"

This commit is contained in:
Jenkins 2016-02-09 09:34:26 +00:00 committed by Gerrit Code Review
commit 9e22d61119
2 changed files with 8 additions and 0 deletions

View File

@ -377,6 +377,11 @@ nsxv_opts = [
"router. This edge_appliance_size will be picked up if "
"--router-size parameter is not specified while doing "
"neutron router-create")),
cfg.ListOpt('nameservers',
default=[],
help=_('List of nameservers to configure for the DHCP binding '
'entries. These will be used if there are no '
'nameservers defined on the subnet.')),
]
# Register the configuration options

View File

@ -717,6 +717,9 @@ class EdgeManager(object):
# set primary and secondary dns
name_servers = [dns['address']
for dns in subnet['dns_nameservers']]
# if no nameservers have been configured then use the ones
# defined in the configuration
name_servers = name_servers or cfg.CONF.nsxv.nameservers
if len(name_servers) == 1:
static_config['primaryNameServer'] = name_servers[0]
elif len(name_servers) >= 2: