vlans: enslave L2 interfaces to device bridge if it exists
Only used on Cumulus switches.
This commit is contained in:
parent
2a67e4911b
commit
44d75a0bb3
1 changed files with 3 additions and 0 deletions
3
vlans.py
3
vlans.py
|
|
@ -139,6 +139,9 @@ class SetVLANScript(Script):
|
|||
|
||||
for port in all_ports:
|
||||
port.enabled = data['enable']
|
||||
# ensure interface is enslaved to the bridge if it exists
|
||||
if bridge := port.device.interfaces.filter(name='bridge'):
|
||||
port.bridge = bridge[0]
|
||||
if tagged_vlans:
|
||||
port.mode = 'tagged'
|
||||
port.save()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue