Commit graph

7 commits

Author SHA1 Message Date
illes
a59fb446f3
Fix KeyError: 'pvid' in lldp.py
```
lldp.eth0.vlan.vlan-id=300
lldp.eth0.vlan.pvid=yes
lldp.eth0.vlan=VLAN300
```
```
Version: lldpd 1.0.11
```

```
{'300': {'pvid': True}, 'VLAN300': {}}
Traceback (most recent call last):
  File "/root/.local/bin/netbox_agent", line 8, in <module>
    sys.exit(main())
  File "/root/.local/lib/python3.10/site-packages/netbox_agent/cli.py", line 44, in main
    return run(config)
  File "/root/.local/lib/python3.10/site-packages/netbox_agent/cli.py", line 39, in run
    server.netbox_create_or_update(config)
  File "/root/.local/lib/python3.10/site-packages/netbox_agent/server.py", line 292, in netbox_create_or_update
    self.network.create_or_update_netbox_network_cards()
  File "/root/.local/lib/python3.10/site-packages/netbox_agent/network.py", line 417, in create_or_update_netbox_network_cards
    ret, interface = self.reset_vlan_on_interface(nic, interface)
  File "/root/.local/lib/python3.10/site-packages/netbox_agent/network.py", line 234, in reset_vlan_on_interface
    pvid_vlan = [key for (key, value) in lldp_vlan.items() if value['pvid']]
  File "/root/.local/lib/python3.10/site-packages/netbox_agent/network.py", line 234, in <listcomp>
    pvid_vlan = [key for (key, value) in lldp_vlan.items() if value['pvid']]
KeyError: 'pvid'
```
2022-04-26 12:25:28 +02:00
ramnes
bdc450ef6a Make flake8 and isort happy 2021-07-09 11:10:43 +02:00
Cyrinux
7999244096
Check if lldpctl present, and log debug if no lldpctl output. (#171) 2020-10-14 12:39:40 +02:00
ramnes
bab2d26ad0 Setup tests 2020-02-02 20:24:01 +01:00
Solvik
f68fed18b4
handle multiple vlans in lldp (#66) 2019-09-09 15:32:14 +02:00
Solvik
197a8babaf
Handle anycast IP (#51) 2019-08-30 11:06:16 +02:00
Solvik
33c55340b7
Add LLDP auto cabling (#41) 2019-08-26 11:05:41 +02:00