From e744f6c8307c4653c3a10b502d4e1908981bd43d Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Fri, 20 Mar 2026 16:01:12 +0200 Subject: vpp: T8286: Uninitialized interfaces raise errors when added to VPP --- python/vyos/vpp/config_filter.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/vyos/vpp/config_filter.py b/python/vyos/vpp/config_filter.py index dc864930b..d0c982f7c 100644 --- a/python/vyos/vpp/config_filter.py +++ b/python/vyos/vpp/config_filter.py @@ -15,6 +15,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +from vyos.base import Warning from vyos.config import Config @@ -42,7 +43,10 @@ def iface_filter_eth(config: Config, iface: str) -> None: 'vrf', ] - # get list of config nides in a session configuration + if not config._session_config.exists(['interfaces', 'ethernet', iface]): + return + + # get list of config nodes in a session configuration iface_nodes = config._session_config.list_nodes(['interfaces', 'ethernet', iface]) # clean cached session config @@ -53,6 +57,6 @@ def iface_filter_eth(config: Config, iface: str) -> None: for cfg_node in iface_nodes: if cfg_node not in allowed_nodes: config._session_config.delete(['interfaces', 'ethernet', iface, cfg_node]) - print( - f'WARNING: {cfg_node} option in {iface} settings is not supported by VPP interfaces. It will be ignored.' + Warning( + f'{cfg_node} option in {iface} settings is not supported by VPP interfaces. It will be ignored.' ) -- cgit v1.2.3