-
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]: Simplify sync_d functions to use higher order #154
[Namespace]: Simplify sync_d functions to use higher order #154
Conversation
functions. Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
src/sonic_ax_impl/mibs/__init__.py
Outdated
result_map[idx].update(ns_tuple[idx]) | ||
for idx, ns_tuple_dict in result_map.items(): | ||
result_list.append(ns_tuple_dict) | ||
return(result_list) |
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.
return(result_list) | |
return result_list | |
``` #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.
Updated as per comment.
src/sonic_ax_impl/mibs/__init__.py
Outdated
""" | ||
Namespace.connect_namespace_dbs(dbs) | ||
def get_sync_d_from_all_namespace(per_namespace_func, dbs): | ||
# return list of dictionaries retrieved from per namespace functions |
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.
return list of dictionaries [](start = 10, length = 27)
You did not return list of dictionaries #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.
we return list of dictionaries, the dictionaries will be the same as return from individual sync_d functions, just that they are merged together.
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.
Probably, we can say "return tuple of dictionaries"
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.
Updated as per review comment.
Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
* [Namespace]: Simplify sync_d functions to use higher order functions. Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com> * Update as per review comments. Signed-off-by: SuvarnaMeenakshi <sumeenak@microsoft.com>
functions.
Signed-off-by: SuvarnaMeenakshi sumeenak@microsoft.com
- What I did
Namespace class was added to support getting data from multiple namespaces.
This class includes some functions which get data from multiple namespaces and combine them.
This PR is to simplify the function of getting from separate functions and merge them.
- How I did it
Write a higher order function to invoke individual function to retrieve data from a single namespace.
The higher order function will retrieve the data and combine.
- How to verify it
No change in single and multi-asic snmp walk outputs.
Only implementation changes.
Make sure snmp walk outputs before change and after change are the same.
- Description for the changelog