bundles/systemd-networkd: support vlans
This commit is contained in:
parent
4213b60052
commit
75d86f3339
4 changed files with 47 additions and 1 deletions
16
bundles/systemd-networkd/metadata.py
Normal file
16
bundles/systemd-networkd/metadata.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
@metadata_reactor
|
||||
def add_vlan_infos_to_interface(metadata):
|
||||
interfaces = {}
|
||||
|
||||
for iface, config in metadata.get('interfaces', {}).items():
|
||||
if not '.' in iface:
|
||||
continue
|
||||
|
||||
interface,vlan = iface.split('.')
|
||||
|
||||
interfaces.setdefault(interface, {}).setdefault('vlans', set())
|
||||
interfaces[interface]['vlans'].add(vlan)
|
||||
|
||||
return {
|
||||
'interfaces': interfaces,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue