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:48:36 +0100 |
commit | 4f790a176ddce4b08148bce093b8577e1acef4ce (patch) | |
tree | 754419c1c455b9a80d40a8c26327a8d7433893e8 | |
parent | bf42ec2bc04c30f85bca15472c1ad04c1366c1d3 (diff) | |
download | vyos-1x-4f790a176ddce4b08148bce093b8577e1acef4ce.tar.gz vyos-1x-4f790a176ddce4b08148bce093b8577e1acef4ce.zip |
op-mode: lldp: T3999: bugfix KeyError: 'capability'
(cherry picked from commit b675c8b6187c4b77759e3f96c9c92dd382dabeae)
-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] |