mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix nxos_bgp_af networks parameter (#28169)
* Split 'networks' and 'redistribute' in get_value * Add missing `'` in docs
This commit is contained in:
parent
59f704c766
commit
19a6000d97
1 changed files with 9 additions and 5 deletions
|
@ -198,7 +198,7 @@ options:
|
||||||
prefixes to advertise. The list must be in the form of an array.
|
prefixes to advertise. The list must be in the form of an array.
|
||||||
Each entry in the array must include a prefix address and an
|
Each entry in the array must include a prefix address and an
|
||||||
optional route-map. For example [['10.0.0.0/16', 'routemap_LA'],
|
optional route-map. For example [['10.0.0.0/16', 'routemap_LA'],
|
||||||
['192.168.1.1', 'Chicago'], ['192.168.2.0/24],
|
['192.168.1.1', 'Chicago'], ['192.168.2.0/24'],
|
||||||
['192.168.3.0/24', 'routemap_NYC']].
|
['192.168.3.0/24', 'routemap_NYC']].
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
|
@ -359,7 +359,12 @@ def get_value(arg, config, module):
|
||||||
if inject_re.search(config):
|
if inject_re.search(config):
|
||||||
value.append('copy_attributes')
|
value.append('copy_attributes')
|
||||||
|
|
||||||
elif arg in ['networks', 'redistribute']:
|
elif arg == 'networks':
|
||||||
|
value = []
|
||||||
|
for network in command_val_re.findall(config):
|
||||||
|
value.append(network.split())
|
||||||
|
|
||||||
|
elif arg == 'redistribute':
|
||||||
value = []
|
value = []
|
||||||
if has_command_val:
|
if has_command_val:
|
||||||
value = has_command_val.group('value').split()
|
value = has_command_val.group('value').split()
|
||||||
|
@ -367,9 +372,8 @@ def get_value(arg, config, module):
|
||||||
if value:
|
if value:
|
||||||
if len(value) == 3:
|
if len(value) == 3:
|
||||||
value.pop(1)
|
value.pop(1)
|
||||||
elif arg == 'redistribute' and len(value) == 4:
|
elif len(value) == 4:
|
||||||
value = ['{0} {1}'.format(
|
value = ['{0} {1}'.format(value[0], value[1]), value[3]]
|
||||||
value[0], value[1]), value[3]]
|
|
||||||
|
|
||||||
elif command == 'distance':
|
elif command == 'distance':
|
||||||
distance_re = r'.*distance\s(?P<d_ebgp>\w+)\s(?P<d_ibgp>\w+)\s(?P<d_local>\w+)'
|
distance_re = r'.*distance\s(?P<d_ebgp>\w+)\s(?P<d_ibgp>\w+)\s(?P<d_local>\w+)'
|
||||||
|
|
Loading…
Reference in a new issue