summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-07 15:30:53 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-07 15:30:55 +0200
commit6f666f0a62fb98fcab800be813141f44dd1ab8a7 (patch)
tree8ee80b5149d26a9e8e84ae2cda3b7c37dddb388e
parenta9756cfd49b169e93afe70415ce9155ebf4e5ffa (diff)
downloadvyos-1x-6f666f0a62fb98fcab800be813141f44dd1ab8a7.tar.gz
vyos-1x-6f666f0a62fb98fcab800be813141f44dd1ab8a7.zip
bonding: T1614: bugfix in validate - enslave failed
Forgot to exclude our current bond interface in the search for duplicate interface enslavement.
-rwxr-xr-xsrc/conf_mode/interface-bonding.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/conf_mode/interface-bonding.py b/src/conf_mode/interface-bonding.py
index cd4c447ac..dc0363fb7 100755
--- a/src/conf_mode/interface-bonding.py
+++ b/src/conf_mode/interface-bonding.py
@@ -272,11 +272,14 @@ def verify(bond):
conf = Config()
for intf in bond['member']:
- # a bond member is only allowed to be assigned to any one bond
- for tmp in conf.list_nodes('interfaces bonding'):
+ # a bonding member interface is only allowed to be assigned to one bond!
+ all_bonds = conf.list_nodes('interfaces bonding')
+ # We do not need to check our own bond
+ all_bonds.remove(bond['intf'])
+ for tmp in all_bonds:
if conf.exists('interfaces bonding ' + tmp + ' member interface ' + intf):
raise ConfigError('can not enslave interface {} which already ' \
- 'belongs to bond {}'.format(intf, tmp))
+ 'belongs to {}'.format(intf, tmp))
# we can not add disabled slave interfaces to our bond
if conf.exists('interfaces ethernet ' + intf + ' disable'):