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][cli][chassis-db] Avoid connecting to chassis db for cli commands executed from linecard #1707
Conversation
Hi @mlorrillere - could you please review, thanks. |
db_list = list(self.db.get_db_list()) | ||
if not device_info.is_supervisor(): | ||
try: | ||
db_list.remove('CHASSIS_APP_DB') |
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.
Similar comment, we can have a function in py_common/multi_asic.py or py_common/deviceinfo to get the list of chassis db instances and use here. Will help in future when we add more DBs
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@judyjoseph, would you please re-start the azure pipeline again? The build is still not picking up the dependednt changes from sonic-net/sonic-buildimage#8065. Thanks |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Currently, for all the cli commands, we connect to all databases mentioned in the database_config.json. The database_config.json also includes the databases from chassis redis server from supervisor card. It is unneccessary to connect to databases from chassis redis server when cli commands are executed form linecard. But we need to allow connection to chassis databases when the cli commands are executed from supervisor card. The changes in this PR fixes this problem. The constructor of Db() class which is instantiated for every CLI command execution is changed to skip chassis databases from the list of collected databases if the card is not supervisor card. Signed-off-by: vedganes <vedavinayagam.ganesan@nokia.com>
is_voq_supervisor() renamed to is_supervisor() as this API is applicable for non VOQ chassis also. Signed-off-by: vedganes <vedavinayagam.ganesan@nokia.com>
ae597de
to
519e4bf
Compare
…commands executed from linecard (#1707) * [multi-asic][cli][chassis-db] Avoid connecting to chassis db Currently, for all the cli commands, we connect to all databases mentioned in the database_config.json. The database_config.json also includes the databases from chassis redis server from supervisor card. It is unneccessary to connect to databases from chassis redis server when cli commands are executed form linecard. But we need to allow connection to chassis databases when the cli commands are executed from supervisor card. The changes in this PR fixes this problem. The constructor of Db() class which is instantiated for every CLI command execution is changed to skip chassis databases from the list of collected databases if the card is not supervisor card. Signed-off-by: vedganes <vedavinayagam.ganesan@nokia.com>
What I did
Currently, for all the cli commands, we connect to all databases mentioned in the database_config.json. The database_config.json also includes the databases from chassis redis server from supervisor card. It is unneccessary to connect to databases from chassis redis server when cli commands are executed form linecard. But we need to allow connection to chassis databases when the cli commands are executed from supervisor card. This problem is fixed by this PR
How I did it
The constructor of Db() class which is instantiated for every CLI command execution is changed to skip chassis databases from the list of collected databases if the card is not supervisor card. This PR is dependent on sonic-buildimage PR sonic-net/sonic-buildimage#8065.
How to verify it
In voq chassis execute some CLI commands (show, config, etc.) and make sure that commands are executed without any CLI errors no matter whether there is supervisor card or not.
Previous command output (if the output of a command-line utility has changed)
No command syntax or outputs changed
New command output (if the output of a command-line utility has changed)
N/A