From e7c027e53e7acae3c630263589edf3104bba39bc Mon Sep 17 00:00:00 2001 From: Adam Smith Date: Mon, 23 Oct 2023 00:07:53 -0400 Subject: T5677: lldp shows empty platform if descr not in lldpctl output (cherry picked from commit fca8cce1c114f28cf2db8a0fe2ed7f8b37ea010c) --- src/op_mode/lldp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/op_mode/lldp.py b/src/op_mode/lldp.py index c287b8fa6..58cfce443 100755 --- a/src/op_mode/lldp.py +++ b/src/op_mode/lldp.py @@ -114,7 +114,10 @@ def _get_formatted_output(raw_data): # Remote software platform platform = jmespath.search('chassis.[*][0][0].descr', values) - tmp.append(platform[:37]) + if platform: + tmp.append(platform[:37]) + else: + tmp.append('') # Remote interface interface = jmespath.search('port.descr', values) -- cgit v1.2.3