Why I did it
Current get_sys_capability_list don't consider the system name of remote device is null case.
If devices don't configure host name, it will send out LLDPPDU whose System Name TLV is null string.
When sonic device learned the remote device, the chassis object of lldp_json does not include system name string.
The capability_list does not get successfully by applying current statement, capability_list = if_attributes['chassis'].values()[0]['capability'].
We can execute lldpctl command to see the difference.
root@sonic:~# docker exec -it lldp bash
root@sonic:/# /usr/sbin/lldpctl -f json
[Remote device without system name]
What I did To fix issue https://github.com/Azure/sonic-dbsyncd/issues/14 and add test cases to parse sys_capability_list for remote devices.
Why I did it Current get_sys_capability_list don't consider the system name of remote device is null case. If devices don't configure host name, it will send out LLDPPDU whose System Name TLV is null string. When sonic device learned the remote device, the chassis object of lldp_json does not include system name string. The capability_list does not get successfully by applying current statement, capability_list = if_attributes['chassis'].values()[0]['capability']. We can execute lldpctl command to see the difference. root@sonic:~# docker exec -it lldp bash root@sonic:/# /usr/sbin/lldpctl -f json [Remote device without system name]
Signed-off-by: kelly_chen kelly_chen@edge-core.com