Page MenuHomeVyOS Platform

vyos.frr class has no support for multi-line modify_section
Confirmed, HighPublicBUG

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)
Issue type
Unspecified (please specify)

Event Timeline

c-po assigned this task to runar.
Viacheslav changed the task status from Open to Needs testing.Jan 20 2024, 1:35 AM
Viacheslav triaged this task as High priority.
Viacheslav subscribed.

Have some bugs:

set vrf name blue ip protocol bgp route-map 'foo-map-in'
set vrf name blue table '1012'
set vrf name green ip protocol bgp route-map 'foo-map-in'
set vrf name green table '1011'
set vrf name red ip protocol bgp route-map 'foo-map-in'
set vrf name red table '1010'

commit:

vyos@r4# delete vrf name blue ip protocol bgp route-map 
[edit]
vyos@r4# commit
[ vrf ]
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
VyOS had an issue completing a command.


Report time:      2024-01-20 03:32:45
Image version:    VyOS 1.5-rolling-202401190024
Release train:    current

Built by:         [email protected]
Built on:         Fri 19 Jan 2024 02:22 UTC
Build UUID:       13700659-ad72-4f7d-ad21-3f2a4b80ab69
Build commit ID:  332e9ab04f168a

Architecture:     x86_64
Boot via:         installed image
System type:      KVM guest

Hardware vendor:  QEMU
Hardware model:   Standard PC (Q35 + ICH9, 2009)
Hardware S/N:     
Hardware UUID:    166cfd25-7d3a-4eca-9ef6-0b655c9acf0f

Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/vrf.py", line 335, in <module>
    apply(c)
  File "/usr/libexec/vyos/conf_mode/vrf.py", line 319, in apply
    frr_cfg.commit_configuration(zebra_daemon)
  File "/usr/lib/python3/dist-packages/vyos/frr.py", line 482, in commit_configuration
    raise ConfigurationNotValid(f'Config commit retry counter ({count_max}) exceeded for {daemon} dameon!')
vyos.frr.ConfigurationNotValid: Config commit retry counter (5) exceeded for zebra dameon!



[[vrf]] failed
Commit failed
dmbaturin set Issue type to Unspecified (please specify).
Viacheslav changed the task status from Needs testing to Confirmed.Feb 16 2024, 2:35 PM
Viacheslav added a project: VyOS 1.5 Circinus.

Still bug for VyOS 1.5-rolling-202402131735