Adapte à la nouvelle version de re2o

This commit is contained in:
chirac 2020-05-23 01:57:09 +02:00 committed by root
parent 58eb2bad62
commit 8defc92ecc

View file

@ -76,10 +76,10 @@ class Switch:
#Trie les ip par vlan, et les ajoute ainsi que les subnet
for ip, subnet in self.switch["interfaces_subnet"].items():
if not subnet[0]["vlan_id"] in vlans:
if not subnet["vlan_id"] in vlans:
raise RuntimeError("La config est dangeureuse, le vlan d'administration n'est pas propagé au switch !")
vlans[subnet[0]["vlan_id"]].setdefault("ipv4", {})
vlans[subnet[0]["vlan_id"]]["ipv4"][ip] = subnet
vlans[subnet["vlan_id"]].setdefault("ipv4", {})
vlans[subnet["vlan_id"]]["ipv4"][ip] = subnet
for ipv6, subnet in self.switch["interfaces6_subnet"].items():
vlans[subnet["vlan_id"]].setdefault("ipv6", {})
vlans[subnet["vlan_id"]]["ipv6"][ipv6] = subnet