2021-01-07 17:44:38 +00:00
|
|
|
@metadata_reactor.provides(
|
|
|
|
'interfaces',
|
|
|
|
)
|
2020-11-13 15:29:17 +00:00
|
|
|
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,
|
|
|
|
}
|