From a5995051bc271907df66618dfb6d7afe62bab551 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 3 Jan 2026 20:52:09 +0100 Subject: ethernet: T8142: do not raise ValueError for non-existing interfaces Call verify_interface_exists() with state_required=True to ensure the interface exists physically and is recognized by the kernel, rather than relying on its presence in the CLI configuration. Unlike bridge or bond interfaces, Ethernet interfaces are not virtual and must be physically present. Ethtool() instance can only be created when the physical interface exists, otherwise a ValueError is raised. --- src/conf_mode/interfaces_ethernet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/conf_mode/interfaces_ethernet.py b/src/conf_mode/interfaces_ethernet.py index d926c458c..a85ccf815 100755 --- a/src/conf_mode/interfaces_ethernet.py +++ b/src/conf_mode/interfaces_ethernet.py @@ -386,11 +386,12 @@ def verify(ethernet): if 'deleted' in ethernet: return None - ethtool = Ethtool(ethernet['ifname']) - verify_interface_exists(ethernet, ethernet['ifname']) + ifname = ethernet['ifname'] + verify_interface_exists(ethernet, ifname, state_required=True) verify_eapol(ethernet) verify_mirror_redirect(ethernet) # No need to check speed and duplex keys as both have default values + ethtool = Ethtool(ifname) verify_speed_duplex(ethernet, ethtool) verify_flow_control(ethernet, ethtool) verify_ring_buffer(ethernet, ethtool) -- cgit v1.2.3