diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-11-28 10:44:12 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-11-28 10:44:12 +0100 |
commit | b675c8b6187c4b77759e3f96c9c92dd382dabeae (patch) | |
tree | bdce32b58de17f1883647d720ead197b5a196fd5 /src | |
parent | 1ec3f5b4573357314c008c6fa073b01a909c259e (diff) | |
download | vyos-1x-b675c8b6187c4b77759e3f96c9c92dd382dabeae.tar.gz vyos-1x-b675c8b6187c4b77759e3f96c9c92dd382dabeae.zip |
op-mode: lldp: T3999: bugfix KeyError: 'capability'
Diffstat (limited to 'src')
-rwxr-xr-x | src/op_mode/lldp_op.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/op_mode/lldp_op.py b/src/op_mode/lldp_op.py index 731e71891..b9ebc991a 100755 --- a/src/op_mode/lldp_op.py +++ b/src/op_mode/lldp_op.py @@ -55,6 +55,9 @@ def parse_data(data, interface): if interface is not None and local_if != interface: continue for chassis, c_value in values.get('chassis', {}).items(): + # bail out early if no capabilities found + if 'capability' not in c_value: + continue capabilities = c_value['capability'] if isinstance(capabilities, dict): capabilities = [capabilities] |