Skip to content

Commit

Permalink
LLDPLocalSystemDataUpdater Exception Log Handled (#249)
Browse files Browse the repository at this point in the history
**- Why I did**

An exception on LLDPLocalSystemDataUpdater instance is seen when the LOC_CHASSIS_TABLE does not have either lldp_loc_sys_cap_supported or lldp_loc_sys_cap_enabled fields.

Although this does not affect an functionality, the exception log can be avoided.

```
tgn-sonic-n1-l1 ERR snmp#snmp-subagent [ax_interface] ERROR: MIBUpdater.start() caught an unexpected exception during update_data()#012Traceback (most recent call last):#12 File " /usr/local/lib/python3.7/dist-packages/ax_interface/mib.py", line 37, in start#012 self.reinit_data ()#12 File "/usr/local/lib/python3.7/dist-packages/sonic_ax_impl/mibs/ieee802_1ab.py", line 129, in reinit_data#012 self.loc_chassis_data['lldp_loc_sys_cap_supported'] = parse_sys_capability(self.loc _chassis_data['lldp_loc_sys_cap_supported'])#012KeyError: 'lldp_loc_sys_cap_supported'
```
  • Loading branch information
vivekrnv authored and qiluo-msft committed Apr 7, 2022
1 parent 60f5237 commit 414692f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sonic_ax_impl/mibs/ieee802_1ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def reinit_data(self):
Namespace.connect_all_dbs(self.db_conn, mibs.APPL_DB)
self.loc_chassis_data = Namespace.dbs_get_all(self.db_conn, mibs.APPL_DB, mibs.LOC_CHASSIS_TABLE)
if self.loc_chassis_data:
self.loc_chassis_data['lldp_loc_sys_cap_supported'] = parse_sys_capability(self.loc_chassis_data['lldp_loc_sys_cap_supported'])
self.loc_chassis_data['lldp_loc_sys_cap_enabled'] = parse_sys_capability(self.loc_chassis_data['lldp_loc_sys_cap_enabled'])
self.loc_chassis_data['lldp_loc_sys_cap_supported'] = parse_sys_capability(self.loc_chassis_data.get('lldp_loc_sys_cap_supported', ''))
self.loc_chassis_data['lldp_loc_sys_cap_enabled'] = parse_sys_capability(self.loc_chassis_data.get('lldp_loc_sys_cap_enabled', ''))

def update_data(self):
"""
Expand Down

0 comments on commit 414692f

Please sign in to comment.