bundlewrap/bundles/systemd-networkd/metadata.py
Franziska Kunsmann 2d42e5f7dd
All checks were successful
bundlewrap/pipeline/head This commit looks good
update bw to 4.3, add .provides() to metadata reactors
2021-01-07 18:44:38 +01:00

18 lines
446 B
Python

@metadata_reactor.provides(
'interfaces',
)
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,
}