Page MenuHomeVyOS Platform

VRRP transition-script does not work for groups name which contains -(minus) sign
Closed, ResolvedPublicBUG

Description

Reproducing steps:

touch /config/scripts/vrrp-backup.sh
touch /config/scripts/vrrp-fault.sh
touch /config/scripts/vrrp-master.sh

sudo chmod +x /config/scripts/vrrp*

configure
set interfaces ethernet eth0 address '198.51.100.1/24'
set high-availability vrrp group G-R-O-U-P-1 hello-source-address '198.51.100.1'
set high-availability vrrp group G-R-O-U-P-1 peer-address '198.51.100.2'
set high-availability vrrp group G-R-O-U-P-1 interface 'eth0'
set high-availability vrrp group G-R-O-U-P-1 transition-script backup '/config/scripts/vrrp-backup.sh'
set high-availability vrrp group G-R-O-U-P-1 transition-script fault '/config/scripts/vrrp-fault.sh'
set high-availability vrrp group G-R-O-U-P-1 transition-script master '/config/scripts/vrrp-master.sh'
set high-availability vrrp group G-R-O-U-P-1 virtual-address '198.51.100.254/24'
set high-availability vrrp group G-R-O-U-P-1 vrid '16'
set high-availability vrrp group G-R-O-U-P-1 priority '50'
commit

Log

Starting FIFO pipe for Keepalived
Feb 02 20:19:01 vyos keepalived-fifo.py[5827]: Loaded configuration: {'group': {'G_R_O_U_P_1': {'hello_source_address': '198.51.100.1', 'interface': 'eth0', 'peer_address': '198.51.100.2', 'priority': '50', 'transition_script': {'backup': '/config/scripts/vrrp-backup.sh', 'fault': '/config/scripts/vrrp-fault.sh', 'master': '/config/scripts/vrrp-master.sh'}, 'virtual_address': ['198.51.100.254/24'], 'vrid': '16'}}}

Looks like something wrong with key_mangling

Details

Difficulty level
Normal (likely a few hours)
Version
1.3.0
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Related Objects

Mentioned In
1.3.1

Event Timeline

@jestabro you are right. Adding no_tag_node_value_mangle=True will fix this issue.
https://github.com/vyos/vyos-1x/blob/ec13cac66ba612ecc36053158c7517c8fe993547/src/system/keepalived-fifo.py#L73-L74

self.vrrp_config_dict = conf.get_config_dict(base,
                                     key_mangling=('-', '_'), get_first_key=True,
                                     no_tag_node_value_mangle=True)
c-po changed the task status from Open to In progress.Feb 5 2022, 7:01 PM
c-po claimed this task.
c-po edited projects, added VyOS 1.3 Equuleus ( 1.3.1); removed VyOS 1.3 Equuleus.