Adapte à la nouvelle version de re2o
This commit is contained in:
parent
58eb2bad62
commit
8defc92ecc
1 changed files with 3 additions and 3 deletions
6
main.py
6
main.py
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue