Fix nxos_bgp_neighbor_af advertise_map and advertise_map_non_exist (#26721)

pull/26906/head
Nathaniel Case 7 years ago committed by GitHub
parent 4d55148ab2
commit 855544604a

@ -305,8 +305,8 @@ PARAM_TO_COMMAND_KEYMAP = {
'neighbor': 'neighbor',
'additional_paths_receive': 'capability additional-paths receive',
'additional_paths_send': 'capability additional-paths send',
'advertise_map_exist': 'advertise-map',
'advertise_map_non_exist': 'advertise-map',
'advertise_map_exist': 'advertise-map exist',
'advertise_map_non_exist': 'advertise-map non-exist',
'allowas_in': 'allowas-in',
'allowas_in_max': 'allowas-in',
'as_override': 'as-override',
@ -599,7 +599,7 @@ def state_present(module, existing, proposed, candidate):
command += ' disable'
commands.append(command)
elif key.startswith('advertise-map'):
direction = key.split()[0]
direction = key.split()[1]
commands.append('advertise-map {1} {0} {2}'.format(direction, *value))
elif key in ['filter-list', 'prefix-list', 'route-map']:
commands.append('{0} {1} {2}'.format(key, *value))

@ -64,3 +64,19 @@ class TestNxosBgpNeighborAfModule(TestNxosModule):
changed=True, sort=False,
commands=['router bgp 65535', 'neighbor 3.3.3.5', 'no address-family ipv4 unicast']
)
def test_nxos_bgp_neighbor_af_advertise_map(self):
set_module_args(dict(asn=65535, neighbor='3.3.3.5', afi='ipv4', safi='unicast',
advertise_map_exist=['my_advertise_map', 'my_exist_map']))
self.execute_module(
changed=True, sort=False,
commands=['router bgp 65535', 'neighbor 3.3.3.5', 'advertise-map my_advertise_map exist my_exist_map']
)
def test_nxos_bgp_neighbor_af_advertise_map_non_exist(self):
set_module_args(dict(asn=65535, neighbor='3.3.3.5', afi='ipv4', safi='unicast',
advertise_map_non_exist=['my_advertise_map', 'my_exist_map']))
self.execute_module(
changed=True, sort=False,
commands=['router bgp 65535', 'neighbor 3.3.3.5', 'advertise-map my_advertise_map non-exist my_exist_map']
)

Loading…
Cancel
Save