From 96e0f5697b181be4f2f3c5c763821ef574881a93 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 6 Sep 2019 10:41:55 +0200 Subject: bonding: T1614: enslaved interfaces can be added to only one bond at a time --- src/conf_mode/interface-bonding.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/conf_mode') diff --git a/src/conf_mode/interface-bonding.py b/src/conf_mode/interface-bonding.py index 81667289d..7b86a0528 100755 --- a/src/conf_mode/interface-bonding.py +++ b/src/conf_mode/interface-bonding.py @@ -270,6 +270,12 @@ 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'): + if conf.exists('interfaces bonding ' + tmp + ' member interface ' + intf): + raise ConfigError('can not add interface {} that is part of another bond ({}) to {}'.format( + intf, tmp, bond['intf'])) + # we can not add disabled slave interfaces to our bond if conf.exists('interfaces ethernet ' + intf + ' disable'): raise ConfigError('can not add disabled interface {} to {}'.format(intf, bond['intf'])) -- cgit v1.2.3