Skip to content

Commit

Permalink
[lldpshow]: Fixed parser logic to handle non mandatory TLV (sonic-net…
Browse files Browse the repository at this point in the history
  • Loading branch information
Hnydyn Nazar authored and Shuotian Cheng committed Oct 5, 2017
1 parent ddadc2b commit 635735d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/lldpshow
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ class Lldpshow(object):
chassis = intf.find('chassis')
capabs = chassis.findall('capability')
capab = self.parse_cap(capabs)
self.lldpsum[l_intf]['r_name'] = chassis.find('name').text
rmt_name = chassis.find('name')
if rmt_name is not None:
self.lldpsum[l_intf]['r_name'] = rmt_name.text
else:
self.lldpsum[l_intf]['r_name'] = ''
remote_port = intf.find('port')
self.lldpsum[l_intf]['r_portid'] = remote_port.find('id').text
rmt_desc = remote_port.find('descr')
Expand Down

0 comments on commit 635735d

Please sign in to comment.