summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces_bonding.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/interfaces_bonding.py')
-rwxr-xr-xsrc/conf_mode/interfaces_bonding.py14
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')