NSX|V: Support tftp-server dhcp option

The DHCP option tftp-server-name is referred to upstream as tftp-server.
This patch supports both names as the same backend option.

Change-Id: Ied936532eafadcd11cb83c51d456509f9d5eedd6
This commit is contained in:
Adit Sarfaty 2017-05-21 09:36:11 +03:00
parent 2d19a0d927
commit b754e5ffd5
3 changed files with 4 additions and 2 deletions

View File

@ -78,6 +78,7 @@ SUPPORTED_DHCP_OPTIONS = {
'bootfile-name': 'option67',
'classless-static-route': 'option121',
'tftp-server-address': 'option150',
'tftp-server': 'option150',
}

View File

@ -942,7 +942,8 @@ class EdgeManager(object):
net, ip = opt_val.split(',')
opt121['staticRoutes'].append({'destinationSubnet': net,
'router': ip})
elif opt_name == 'tftp-server-address':
elif (opt_name == 'tftp-server-address' or
opt_name == 'tftp-server'):
if 'option150' not in static_config['dhcpOptions']:
static_config['dhcpOptions']['option150'] = {
'tftpServers': []}

View File

@ -5506,7 +5506,7 @@ class DHCPOptsTestCase(test_dhcpopts.TestExtraDhcpOpt,
def test_update_port_with_blank_string_extradhcpopt(self):
opt_list = [{'opt_name': 'bootfile-name', 'opt_value': 'pxelinux.0'},
{'opt_name': 'tftp-server-address',
{'opt_name': 'tftp-server',
'opt_value': '123.123.123.123'}]
upd_opts = [{'opt_name': 'bootfile-name', 'opt_value': ' '}]