-
Notifications
You must be signed in to change notification settings - Fork 113
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
Changes from 3 commits
16f36d8
af7d4f4
7cfc43d
e264498
a10f55f
2fd0960
7e9eb50
9c4efd6
fbba260
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -552,12 +552,15 @@ def dbs_get_all(dbs, db_name, _hash, *args, **kwargs): | |
db get_all function executed on global and all namespace DBs. | ||
""" | ||
result = {} | ||
# If there are multiple namespaces, _hash might not be | ||
# present in all namespace, ignore if not present in a | ||
# specfic namespace. | ||
if (len(dbs) > 1) : kwargs['blocking'] = False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
you can remove '()' #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed as per comment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This parameter is passed as reference, and it is mutable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @qiluo-msft We were initially updating all the function call arguments and the changes were spread in multiple places. This approach looks better where only for Multi-Asic we are making blocking as False and for single asic behavior remains unchanged. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per suggestion, instead of modifying kwargs directly, did a shallow copy to change. |
||
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) | ||
ns_result = db_conn.get_all(db_name, _hash, *args, **kwargs) | ||
if ns_result is not None: | ||
result.update(ns_result) | ||
return result | ||
|
||
@staticmethod | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move it in next line. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed as per comment.