summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-05-08 21:38:34 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-05-10 13:13:52 +0000
commit5f968fe519372c3219ad550555dc499eafb6043f (patch)
tree6936323dd12430f08acbc25f6fb8b0ad530dcce2 /src/conf_mode
parent4960a67e12c1d10a59812f0167f017131a9617b5 (diff)
downloadvyos-1x-5f968fe519372c3219ad550555dc499eafb6043f.tar.gz
vyos-1x-5f968fe519372c3219ad550555dc499eafb6043f.zip
bridge: T6317: call dependency when deleting bridge member
(cherry picked from commit 31fc5372961547bb352c56eb2f4149fd195e9be1)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/interfaces_bridge.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/conf_mode/interfaces_bridge.py b/src/conf_mode/interfaces_bridge.py
index 9789f7bd3..69e657830 100755
--- a/src/conf_mode/interfaces_bridge.py
+++ b/src/conf_mode/interfaces_bridge.py
@@ -56,6 +56,14 @@ def get_config(config=None):
bridge['member'].update({'interface_remove' : tmp })
else:
bridge.update({'member' : {'interface_remove' : tmp }})
+ for interface in tmp:
+ # When using VXLAN member interfaces that are configured for Single
+ # VXLAN Device (SVD) we need to call the VXLAN conf-mode script to
+ # re-create VLAN to VNI mappings if required, but only if the interface
+ # is already live on the system - this must not be done on first commit
+ if interface.startswith('vxlan') and interface_exists(interface):
+ set_dependents('vxlan', conf, interface)
+
if dict_search('member.interface', bridge) is not None:
for interface in list(bridge['member']['interface']):
@@ -168,12 +176,19 @@ def apply(bridge):
else:
br.update(bridge)
- for interface in dict_search('member.interface', bridge) or []:
- if interface.startswith('vxlan') and interface_exists(interface):
+ tmp = []
+ if 'member' in bridge:
+ if 'interface_remove' in bridge['member']:
+ tmp.extend(bridge['member']['interface_remove'])
+ if 'interface' in bridge['member']:
+ tmp.extend(bridge['member']['interface'])
+
+ for interface in tmp:
+ if interface.startswith(tuple(['vxlan'])) and interface_exists(interface):
try:
call_dependents()
except ConfigError:
- raise ConfigError('Error in updating VXLAN interface after changing bridge!')
+ raise ConfigError('Error updating member interface configuration after changing bridge!')
return None