summaryrefslogtreecommitdiff
path: root/src/conf_mode/vrf_vni.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-27 10:32:02 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-27 10:32:02 +0100
commit79e91d9193aa118663626dd79450aa608f3a1a04 (patch)
tree160917f929cba439bc814047223447fd5f298be0 /src/conf_mode/vrf_vni.py
parentff4e9245b4cc187124345171c07fd22b0aae7377 (diff)
downloadvyos-1x-79e91d9193aa118663626dd79450aa608f3a1a04.tar.gz
vyos-1x-79e91d9193aa118663626dd79450aa608f3a1a04.zip
vrf: vni: T3753: adjust to new FRR 8.1 syntax
Diffstat (limited to 'src/conf_mode/vrf_vni.py')
-rwxr-xr-xsrc/conf_mode/vrf_vni.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/vrf_vni.py b/src/conf_mode/vrf_vni.py
index ca7eb7849..a357f30dd 100755
--- a/src/conf_mode/vrf_vni.py
+++ b/src/conf_mode/vrf_vni.py
@@ -47,8 +47,9 @@ def apply(vrf):
# add configuration to FRR
frr_cfg = frr.FRRConfig()
frr_cfg.load_configuration(frr_daemon)
- frr_cfg.modify_section(f'^vrf .+$', '')
- frr_cfg.add_before(r'(interface .*|line vty|end)', vrf['new_frr_config'])
+ frr_cfg.modify_section(f'^vrf .+', '')
+ if 'new_frr_config' in vrf:
+ frr_cfg.add_before(frr.default_add_before, vrf['new_frr_config'])
frr_cfg.commit_configuration(frr_daemon)
# Save configuration to /run/frr/config/frr.conf