Skip to content

Commit 21d7d97

Browse files
authored
Fix: SonicV2Connector behavior change: get_all will return empty dict if (#226)
the hash does not exist in Redis - What I did Fixes #8140 ref: swsssdk implementation returns None, and the library will be deprecated libswsscommon implementation returns empty dict - How I did it Relax the condition check to accept both representations - How to verify it Unit test Signed-off-by: Qi Luo <qiluo-msft@users.noreply.github.com>
1 parent 0813b42 commit 21d7d97

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/sonic_ax_impl/mibs/ietf/rfc1213.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def _update_from_db(self):
7979
neigh_str = neigh_key
8080
db_index = self.neigh_key_list[neigh_key]
8181
neigh_info = self.db_conn[db_index].get_all(mibs.APPL_DB, neigh_key, blocking=False)
82-
if neigh_info is None:
82+
if not neigh_info:
8383
continue
8484
ip_family = neigh_info['family']
8585
if ip_family == "IPv4":

src/sonic_ax_impl/mibs/ietf/rfc4292.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def update_data(self):
6565
continue
6666
port_table = multi_asic.get_port_table_for_asic(db_conn.namespace)
6767
ent = db_conn.get_all(mibs.APPL_DB, route_str, blocking=False)
68-
if ent is None:
68+
if not ent:
6969
continue
7070
nexthops = ent["nexthop"]
7171
ifnames = ent["ifname"]

0 commit comments

Comments
 (0)