VyOS uses hard-coded priorities for CLI nodes to ensure the system is configured in a specific order.
As most of you know priorities can be listed using /opt/vyatta/sbin/priority.pl
During debugging of T5428 I noticed that the VRF configuration script is executed prior to the interface script when removing things.
To test:
set interfaces ethernet eth2 vrf purple4 set interfaces ethernet eth2 address dhcp set vrf name purple4 table 65000
Now remove the interface based VRF configuration and the VRF
[email protected]# delete vrf [email protected]# delete interfaces ethernet eth2 vrf [email protected]# commit
[ vrf ] <- Priority 299 Hello from vrf.py [ interfaces ethernet eth2 ] <- Priority 318 Hello from interfaces-ethernet.py
I've first seen this in syslog as it looked weird to me seeing the vrf script getting executred first:
Aug 18 13:49:16 sudo[4427]: cpo : TTY=pts/0 ; PWD=/home/cpo ; USER=root ; COMMAND=/usr/bin/sh -c ' /usr/libexec/vyos/conf_mode/vrf.py' ... noise ... Aug 18 13:49:17 sudo[4458]: cpo : TTY=pts/0 ; PWD=/home/cpo ; USER=root ; COMMAND=/usr/bin/sh -c ' VYOS_TAGNODE_VALUE=\'eth2\' /usr/libexec/vyos/conf_mode/interfaces-ethernet.py'
In my humble opinion, priorities should be executed ascending during set commands and descending (high to low) when deleting CLI nodes.