From 5b15c162c008958de2be9cba2cbf8f0b65bc6fb9 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 3 Aug 2019 22:24:10 +0200 Subject: [bridge] T1156: interfaces can be assigned to any one bridge only --- src/conf_mode/interface-bridge.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/conf_mode/interface-bridge.py b/src/conf_mode/interface-bridge.py index 637c58a5e..1c9c6ec10 100755 --- a/src/conf_mode/interface-bridge.py +++ b/src/conf_mode/interface-bridge.py @@ -174,8 +174,16 @@ def verify(bridge): if bridge is None: return None - # validate agains other bridge interfaces that the interface is not assigned - # to another bridge + conf = Config() + for br in conf.list_nodes('interfaces bridge'): + # it makes no sense to verify ourself in this case + if br == bridge['br_name']: + continue + + for intf in bridge['member']: + tmp = conf.list_nodes('interfaces bridge {} member interface'.format(br)) + if intf['name'] in tmp: + raise ConfigError('{} can be assigned to any one bridge only'.format(intf['name'])) return None -- cgit v1.2.3