Skip to content

Commit 635735d

Browse files
Hnydyn NazarShuotian Cheng
Hnydyn Nazar
authored and
Shuotian Cheng
committed
[lldpshow]: Fixed parser logic to handle non mandatory TLV (sonic-net#110)
1 parent ddadc2b commit 635735d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/lldpshow

+5-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,11 @@ class Lldpshow(object):
7777
chassis = intf.find('chassis')
7878
capabs = chassis.findall('capability')
7979
capab = self.parse_cap(capabs)
80-
self.lldpsum[l_intf]['r_name'] = chassis.find('name').text
80+
rmt_name = chassis.find('name')
81+
if rmt_name is not None:
82+
self.lldpsum[l_intf]['r_name'] = rmt_name.text
83+
else:
84+
self.lldpsum[l_intf]['r_name'] = ''
8185
remote_port = intf.find('port')
8286
self.lldpsum[l_intf]['r_portid'] = remote_port.find('id').text
8387
rmt_desc = remote_port.find('descr')

0 commit comments

Comments
 (0)