diff options
| author | Christian Breunig <christian@breunig.cc> | 2025-12-19 21:10:14 +0100 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2025-12-19 21:51:28 +0100 |
| commit | a7af7360e3f2d4635d7bf0340d183f01e3846aa9 (patch) | |
| tree | 4aa1f8a18bd5db5d742266cef6b8b984b05bb3b1 | |
| parent | 617c99b89aa2b9df985f573159d78212983a5451 (diff) | |
| download | vyos-1x-a7af7360e3f2d4635d7bf0340d183f01e3846aa9.tar.gz vyos-1x-a7af7360e3f2d4635d7bf0340d183f01e3846aa9.zip | |
bond: T8084: remove dynamic interface type detection via vyos.ifconfig.Section
Aggregated / bonded interfaces do only work with ethernet interfaces as
underlaying link. There is no need to "dynamically" detect that eth0, eth1 or
any other interface starting with eth is an ethernet interface.
Remove calls to vyos.ifconfig.Section().
| -rwxr-xr-x | src/conf_mode/interfaces_bonding.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/conf_mode/interfaces_bonding.py b/src/conf_mode/interfaces_bonding.py index f844d0a21..3f6450076 100755 --- a/src/conf_mode/interfaces_bonding.py +++ b/src/conf_mode/interfaces_bonding.py @@ -34,7 +34,6 @@ from vyos.frrender import FRRender from vyos.frrender import get_frrender_dict from vyos.ifconfig import BondIf from vyos.ifconfig.ethernet import EthernetIf -from vyos.ifconfig import Section from vyos.utils.assertion import assert_mac from vyos.utils.dict import dict_search from vyos.utils.dict import dict_to_paths_values @@ -114,8 +113,7 @@ def get_config(config=None): # ethernet commit again in apply function # to apply options under ethernet section set_dependents('ethernet', conf, interface) - section = Section.section(interface) # this will be 'ethernet' for 'eth0' - if conf.exists([section, interface, 'disable']): + if conf.exists(['ethernet', interface, 'disable']): tmp[interface] = {'disable': ''} else: tmp[interface] = {} @@ -144,14 +142,8 @@ def get_config(config=None): bond['shutdown_required'] = {} bond['member']['interface'][interface].update({'new_added' : {}}) - # Check if member interface is disabled - conf.set_level(['interfaces']) - - section = Section.section(interface) # this will be 'ethernet' for 'eth0' - if conf.exists([section, interface, 'disable']): - if tmp: bond['member']['interface'][interface].update({'disable': ''}) - - conf.set_level(old_level) + if 'disable' in interface_ethernet_config: + bond['member']['interface'][interface].update({'disable': ''}) # Check if member interface is already member of another bridge tmp = is_member(conf, interface, 'bridge') |
