-
Notifications
You must be signed in to change notification settings - Fork 752
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
[multi-asic]: Add function to load database config #4112
Conversation
on single asic or multi-asic platform. Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
functions that connect to db. Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
ansible/library/lag_facts.py
Outdated
@@ -70,6 +71,8 @@ def get_po_names(self): | |||
self.module.fail_json(msg=fail_msg) | |||
else: | |||
for po in out.split(): | |||
# load db config | |||
load_db_config() |
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.
can we do load_db_config
just once in the beginning, iso doing for every portchannel or every NS?
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 suggested.
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.
as comments
Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
/Azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
What is the motivation for this PR? With the changes in sonic-net/sonic-buildimage#8173, the applications that connect to namespace dbs have to load global database configuration. Due to this change, the sonic-py-common.multi_asic functions that connect to database will fail if database configuration is not loaded in ansible library functions. How did you do it? Add a new module_utility library function to load the right db configuration based on single or multi-asic platform. Invoke this function in port_util and lag_facts where mutli_asic library function is invoked which connects to db. How did you verify/test it? Bring up a multi-asic VS testbed. ./testbed-cli.sh -t vtestbed.csv -m veos_vtb -k ceos add-topo vms-kvm-four-asic-t1-lag password.txt Before adding this change, failure seen while running test_bgp_fact.py
Description of PR
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
With the changes in sonic-net/sonic-buildimage#8173, the applications that connect to namespace dbs have to load global database configuration. Due to this change, the sonic-py-common.multi_asic functions that connect to database will fail if database configuration is not loaded in ansible library functions.
How did you do it?
Add a new module_utility library function to load the right db configuration based on single or multi-asic platform.
Invoke this function in port_util and lag_facts where mutli_asic library function is invoked which connects to db.
How did you verify/test it?
Bring up a multi-asic VS testbed.
./testbed-cli.sh -t vtestbed.csv -m veos_vtb -k ceos add-topo vms-kvm-four-asic-t1-lag password.txt
Before adding this change, failure seen while running test_bgp_fact.py
After fix:
=== Running tests individually ===
Tested the same with 201911 VS image to ensure that changes do not impact test cases running on 201911 image.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation