summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-05-09 10:03:51 +0200
committerChristian Poessinger <christian@poessinger.com>2021-05-09 10:03:51 +0200
commit1a278c1143b8d7a9fe43a6bc098d12ca5db19a32 (patch)
treeda2034cdd5b221db5a1ec1f2a23d9d98821af55e
parent4cdb1f8b25f46297cb286923e9e9116964189a31 (diff)
downloadvyos-1x-1a278c1143b8d7a9fe43a6bc098d12ca5db19a32.tar.gz
vyos-1x-1a278c1143b8d7a9fe43a6bc098d12ca5db19a32.zip
bgp: T3530: add hyphen support for peer-group names
-rw-r--r--data/templates/frr/bgpd.frr.tmpl1
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py4
2 files changed, 3 insertions, 2 deletions
diff --git a/data/templates/frr/bgpd.frr.tmpl b/data/templates/frr/bgpd.frr.tmpl
index 57b9ba8d6..5edd3f97d 100644
--- a/data/templates/frr/bgpd.frr.tmpl
+++ b/data/templates/frr/bgpd.frr.tmpl
@@ -404,6 +404,7 @@ router bgp {{ local_as }} {{ 'vrf ' ~ vrf if vrf is defined and vrf is not none
{% endif %}
{% if parameters.bestpath.as_path is defined and parameters.bestpath.as_path is not none %}
{% for option in parameters.bestpath.as_path %}
+{# replace is required for multipath-relax option #}
bgp bestpath as-path {{ option|replace('_', '-') }}
{% endfor %}
{% endif %}
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index a51fe6d72..74253c2d7 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -47,7 +47,8 @@ def get_config(config=None):
# eqivalent of the C foo ? 'a' : 'b' statement
base = vrf and ['vrf', 'name', vrf, 'protocols', 'bgp'] or base_path
- bgp = conf.get_config_dict(base, key_mangling=('-', '_'), get_first_key=True)
+ bgp = conf.get_config_dict(base, key_mangling=('-', '_'),
+ get_first_key=True, no_tag_node_value_mangle=True)
# Assign the name of our VRF context. This MUST be done before the return
# statement below, else on deletion we will delete the default instance
@@ -225,7 +226,6 @@ def verify(bgp):
else:
for key in ['external', 'internal', 'local']:
if dict_search(f'address_family.{address_family_name}.distance.{key}', bgp) == None:
- address_family_name = address_family_name.replace('_', '-')
raise ConfigError('Missing mandatory configuration option for '\
f'{address_family_name} administrative distance {key}!')