Merge "Handle LLDP parse Unicode error"
This commit is contained in:
commit
c4a177c8eb
@ -53,7 +53,16 @@ class LLDPBasicProcessingHook(base.ProcessingHook):
|
||||
{'tlv_type': tlv_type, 'msg': e}, node_info=node_info)
|
||||
continue
|
||||
|
||||
if parser.parse_tlv(tlv_type, data):
|
||||
try:
|
||||
parsed_tlv = parser.parse_tlv(tlv_type, data)
|
||||
except UnicodeDecodeError as e:
|
||||
LOG.warning("LLDP TLV type %(tlv_type)d can't be decoded: "
|
||||
"%(exc)s",
|
||||
{'tlv_type': tlv_type, 'exc': e},
|
||||
node_info=node_info)
|
||||
continue
|
||||
|
||||
if parsed_tlv:
|
||||
LOG.debug("Handled TLV type %d",
|
||||
tlv_type, node_info=node_info)
|
||||
else:
|
||||
|
9
releasenotes/notes/fix-lldp-decode-83f4ad3869b0c7a7.yaml
Normal file
9
releasenotes/notes/fix-lldp-decode-83f4ad3869b0c7a7.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
In case the lldp raw data collected by the inspection process
|
||||
includes non utf-8 information, the parser fails breaking
|
||||
the inspection process.
|
||||
This patch works around that excluding the malformed data
|
||||
and adding an entry in the logs to provide information
|
||||
on the failed tlv.
|
Loading…
Reference in New Issue
Block a user