diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-08-29 12:08:22 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-08-29 12:08:22 +0200 |
commit | 40bfaed4d1d427c33157136026944df80e02a5b6 (patch) | |
tree | dffae855d355f5d8fe9139c686500739aa303a9e /src/conf_mode | |
parent | 33ccbfdd0b367a2416c3a8b41a73d7477123d276 (diff) | |
download | vyos-1x-40bfaed4d1d427c33157136026944df80e02a5b6.tar.gz vyos-1x-40bfaed4d1d427c33157136026944df80e02a5b6.zip |
ospf: T3236: add possibility to redistribute "table"
Add new CLI command:
* "set protocols ospf redistribute table <n>"
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/protocols_ospf.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/conf_mode/protocols_ospf.py b/src/conf_mode/protocols_ospf.py index 06a29106d..92532fcb5 100755 --- a/src/conf_mode/protocols_ospf.py +++ b/src/conf_mode/protocols_ospf.py @@ -87,7 +87,13 @@ def get_config(config=None): del default_values['area']['area_type']['nssa'] if 'mpls_te' not in ospf: del default_values['mpls_te'] - for protocol in ['bgp', 'connected', 'isis', 'kernel', 'rip', 'static']: + + for protocol in ['bgp', 'connected', 'isis', 'kernel', 'rip', 'static', 'table']: + # table is a tagNode thus we need to clean out all occurances for the + # default values and load them in later individually + if protocol == 'table': + del default_values['redistribute']['table'] + continue if dict_search(f'redistribute.{protocol}', ospf) is None: del default_values['redistribute'][protocol] @@ -127,6 +133,12 @@ def get_config(config=None): ospf['interface'][interface] = dict_merge(default_values, ospf['interface'][interface]) + if 'redistribute' in ospf and 'table' in ospf['redistribute']: + default_values = defaults(base + ['redistribute', 'table']) + for table in ospf['redistribute']['table']: + ospf['redistribute']['table'][table] = dict_merge(default_values, + ospf['redistribute']['table'][table]) + # We also need some additional information from the config, prefix-lists # and route-maps for instance. They will be used in verify(). # |