Page MenuHomeVyOS Platform

vyos.frr class has no support for multi-line modify_section
Open, Requires assessmentPublicBUG

Description

While implementing T3523 I noticed that the current implementation of the vyos.frr class lacks support for "finding a line" inside a section.

Imaging the following FRR configuration:

!
vrf red
 ip protocol bgp route-map foo-map-in
 exit-vrf
!
vrf green
 ip protocol bgp route-map foo-map-in
 exit-vrf
!
vrf blue
 ip protocol bgp route-map foo-map-in
 exit-vrf
!

Now if we wan't to remove the ip protocol bgp route-map from vrf blue this is not possible, as when using a regex for frr_cfg.modify_section(r'(\s+)?ip protocol bgp route-map [-a-zA-Z0-9.]+$', '', '(\s|!)') this will match for all VRFs.

Details

Difficulty level
Unknown (require assessment)
Version
1.4-rolling-202105072156
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

c-po created this task.