summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig/bond.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-09-03 17:07:48 +0200
committerGitHub <noreply@github.com>2022-09-03 17:07:48 +0200
commite7719b7be2f817834d988e10368a39e419c44263 (patch)
treec558b084cc1fbeb1f0acd10e7ed7603379741a4d /python/vyos/ifconfig/bond.py
parent735767f09f891c438e43565f935b927e6f1b317d (diff)
parent95e7676aa8ae5b3476b14a334b3815c2ae59f8d6 (diff)
downloadvyos-1x-e7719b7be2f817834d988e10368a39e419c44263.tar.gz
vyos-1x-e7719b7be2f817834d988e10368a39e419c44263.zip
Merge pull request #1517 from initramfs/current-fix-bond-members
bonding: T4668: Fix bond members not adding/interface state incorrect
Diffstat (limited to 'python/vyos/ifconfig/bond.py')
-rw-r--r--python/vyos/ifconfig/bond.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/python/vyos/ifconfig/bond.py b/python/vyos/ifconfig/bond.py
index 98bf6162b..0edd17055 100644
--- a/python/vyos/ifconfig/bond.py
+++ b/python/vyos/ifconfig/bond.py
@@ -1,4 +1,4 @@
-# Copyright 2019-2021 VyOS maintainers and contributors <maintainers@vyos.io>
+# Copyright 2019-2022 VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -405,10 +405,12 @@ class BondIf(Interface):
# Remove ALL bond member interfaces
for interface in self.get_slaves():
self.del_port(interface)
- # Removing an interface from a bond will always place the underlaying
- # physical interface in admin-down state! If physical interface is
- # not disabled, re-enable it.
- if not dict_search(f'member.interface_remove.{interface}.disable', config):
+
+ # Restore correct interface status based on config
+ if dict_search(f'member.interface.{interface}.disable', config) is not None or \
+ dict_search(f'member.interface_remove.{interface}.disable', config) is not None:
+ Interface(interface).set_admin_state('down')
+ else:
Interface(interface).set_admin_state('up')
# Bonding policy/mode - default value, always present