Skip to content

[ieee802_1ab]Ensuring that the LLDP_system_data is non-empty before getting field from it.#135

Open
sdddean wants to merge 1 commit intosonic-net:masterfrom
sdddean:master
Open

[ieee802_1ab]Ensuring that the LLDP_system_data is non-empty before getting field from it.#135
sdddean wants to merge 1 commit intosonic-net:masterfrom
sdddean:master

Conversation

@sdddean
Copy link

@sdddean sdddean commented Jun 17, 2020

Signed-off-by: sundandan sundandan@asterfusion.com

What I did
Add a non-empty protection before getting field form local_chassis_date.

Why I did it
As the logic in sonic-dbsyncd, there will be no 'LLDP_LOC_CHASSIS' table in APP DB until we establish neighbor relationships with LLDP neighbors.
When there is no 'LLDP_LOC_CHASSIS' table in APP DB, walk node .1.0.8802.1.1.2.1.3 will led to error log:

Jun 4 03:30:18.191672 leaf-229 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.6/dist-packages/ax_interface/mib.py", line 37, in start#012 self.reinit_data()#12 File "/usr/local/lib/python3.6/dist-packages/sonic_ax_impl/mibs/ieee802_1ab.py", line 115, in reinit_data#012 self.loc_chassis_data[b'lldp_loc_sys_cap_supported'] = parse_sys_capability(self.loc_chassis_data[b'lldp_loc_sys_cap_supported'])#012TypeError: 'NoneType' object is not subscriptable

How I verified it
The error log described above does not appear anymore.

…field from it.

Signed-off-by: sundandan <sundandan@asterfusion.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant