diff options
| author | Daniil Baturin <daniil@vyos.io> | 2026-03-26 15:15:31 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-26 15:15:31 +0000 |
| commit | 9ed6c0c2ab164cbd3ed05a5b559135435841dd03 (patch) | |
| tree | a2d2f2e4c7e9a29efddc6ea4f936b0656077f33a /python | |
| parent | fa866ce702e9235b0803f926364eef3c9d3b3dc4 (diff) | |
| parent | e744f6c8307c4653c3a10b502d4e1908981bd43d (diff) | |
| download | vyos-1x-9ed6c0c2ab164cbd3ed05a5b559135435841dd03.tar.gz vyos-1x-9ed6c0c2ab164cbd3ed05a5b559135435841dd03.zip | |
Merge pull request #5069 from natali-rs1985/T8286
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.' ) |
