Skip to content

Commit

Permalink
Fix LLDP local port description field (#91)
Browse files Browse the repository at this point in the history
Return empty string if port description is not present in DB
  • Loading branch information
stepanblyschak authored and qiluo-msft committed Oct 22, 2018
1 parent c675724 commit 10f59f2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/sonic_ax_impl/mibs/ieee802_1ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,8 @@ def port_table_lookup(self, sub_id, table_name):
return None
counters = self.loc_port_data[if_name]
_table_name = bytes(getattr(table_name, 'name', table_name), 'utf-8')
try:
return counters[_table_name]
except KeyError as e:
logger.warning(" 0 - b'PORT_TABLE' missing attribute '{}'.".format(e))
return None

return counters.get(_table_name, '')

def port_id_subtype(self, sub_id):
"""
Expand Down

0 comments on commit 10f59f2

Please sign in to comment.