Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[watermarkstat] Fix for error in processing empty array from couters …
…db (#1810) With switch to swsscommon, the get operations return NULL ('') if there are no entries in any table. But the existing code for handling counters values in the case of absence of entries assumes that the get operations return 'None', which was the case with swsssdk. This was causing problem. For PG_WATERMARK_STAT_COUNTER SAI does not support SAI_INGRESS_PRIORITY_GROUP_STAT_XOFF_ROOM_WATERMARK_BYTES and SAI_INGRESS_PRIORITY_GROUP_STAT_SHARED_WATERMARK_BYTES. So there are no objects in the counters db. With swsscommon, in the absence of objects, an empty string ('') is returned instead of 'None'. The code expecting 'None' tries to converts the empty string to integer and throws error. This is fixed by adding check for empty string in addition to 'None'. Signed-off-by: vedganes <vedavinayagam.ganesan@nokia.com>
- Loading branch information