diff options
| author | Nataliia Solomko <natalirs1985@gmail.com> | 2026-03-20 16:01:12 +0200 |
|---|---|---|
| committer | Nataliia Solomko <natalirs1985@gmail.com> | 2026-03-26 15:12:43 +0200 |
| commit | e744f6c8307c4653c3a10b502d4e1908981bd43d (patch) | |
| tree | f42937d348d613c850076f0df5f4b5a15023a792 /python | |
| parent | fc06cc45148a42171baf9f4ae01da33c3f0df1aa (diff) | |
| download | vyos-1x-e744f6c8307c4653c3a10b502d4e1908981bd43d.tar.gz vyos-1x-e744f6c8307c4653c3a10b502d4e1908981bd43d.zip | |
vpp: T8286: Uninitialized interfaces raise errors when added to VPP
Diffstat (limited to 'python')
| -rw-r--r-- | python/vyos/vpp/config_filter.py | 10 |
1 files changed, 7 insertions, 3 deletions
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.' ) |
