Merge "NSX|V: add ability for admin to configure default nameservers"
This commit is contained in:
commit
9e22d61119
@ -377,6 +377,11 @@ nsxv_opts = [
|
|||||||
"router. This edge_appliance_size will be picked up if "
|
"router. This edge_appliance_size will be picked up if "
|
||||||
"--router-size parameter is not specified while doing "
|
"--router-size parameter is not specified while doing "
|
||||||
"neutron router-create")),
|
"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
|
# Register the configuration options
|
||||||
|
@ -717,6 +717,9 @@ class EdgeManager(object):
|
|||||||
# set primary and secondary dns
|
# set primary and secondary dns
|
||||||
name_servers = [dns['address']
|
name_servers = [dns['address']
|
||||||
for dns in subnet['dns_nameservers']]
|
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:
|
if len(name_servers) == 1:
|
||||||
static_config['primaryNameServer'] = name_servers[0]
|
static_config['primaryNameServer'] = name_servers[0]
|
||||||
elif len(name_servers) >= 2:
|
elif len(name_servers) >= 2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user