Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Namespace]: Fix SNMP AgentX socket connection timeout when using Namespace.get_all() #140

Merged
merged 9 commits into from
Jul 11, 2020
14 changes: 9 additions & 5 deletions src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,12 +552,16 @@ def dbs_get_all(dbs, db_name, _hash, *args, **kwargs):
db get_all function executed on global and all namespace DBs.
"""
result = {}
Namespace.connect_all_dbs(dbs, db_name)
if len(dbs) == 1:
abdosi marked this conversation as resolved.
Show resolved Hide resolved
return dbs[0].get_all(db_name, _hash, *args, **kwargs)
for db_conn in dbs:
db_conn.connect(db_name)
if(db_conn.exists(db_name, _hash)):
ns_result = db_conn.get_all(db_name, _hash, *args, **kwargs)
if ns_result is not None:
result.update(ns_result)
# If there are multiple namespaces, _hash might not be
# present in all namespace, ignore if not present in a
# specfic namespace.
ns_result = db_conn.get_all(db_name, _hash, blocking=False)
abdosi marked this conversation as resolved.
Show resolved Hide resolved
if ns_result is not None:
result.update(ns_result)
return result

@staticmethod
Expand Down