summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-04-04 21:29:59 +0200
committerChristian Breunig <christian@breunig.cc>2025-04-04 21:42:20 +0200
commit330af6a781e9a83dcfd2721011a7acc1bf47caed (patch)
tree1f4a80a70a3a54fe98769b24bdaf4e86cc5516db
parent85d44fbe2befb4789a38996ea899dec57c40a29a (diff)
downloadvyos-1x-330af6a781e9a83dcfd2721011a7acc1bf47caed.tar.gz
vyos-1x-330af6a781e9a83dcfd2721011a7acc1bf47caed.zip
frrender: T7273: always start from the configs root level
Working on T7273 revealed that when committing the following CLI config "set interfaces vxlan vxlan0 parameters neighbor-suppress" the CLI level queried via conf.get_level() was at ['interfaces', 'vxlan']. This had the side effect that queries on the configuration like: conf.exists(['protocols', 'bgp']) returned False, as it would look accidently at the level: ['interfaces', 'vxlan', 'protocols', 'bgp'] This error was there from the beginning of the FRRender class implementation.
-rw-r--r--python/vyos/frrender.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/vyos/frrender.py b/python/vyos/frrender.py
index ba44978d1..8d469e3e2 100644
--- a/python/vyos/frrender.py
+++ b/python/vyos/frrender.py
@@ -60,6 +60,10 @@ def get_frrender_dict(conf, argv=None) -> dict:
from vyos.configdict import get_dhcp_interfaces
from vyos.configdict import get_pppoe_interfaces
+ # We need to re-set the CLI path to the root level, as this function uses
+ # conf.exists() with an absolute path form the CLI root
+ conf.set_level([])
+
# Create an empty dictionary which will be filled down the code path and
# returned to the caller
dict = {}
@@ -599,8 +603,10 @@ def get_frrender_dict(conf, argv=None) -> dict:
dict.update({'vrf' : vrf})
if os.path.exists(frr_debug_enable):
+ print(f'---- get_frrender_dict({conf}) ----')
import pprint
pprint.pprint(dict)
+ print('-----------------------------------')
return dict