-
Notifications
You must be signed in to change notification settings - Fork 156
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
[chassisd] Add script to initialize chassis info in STATE_DB #183
Conversation
This pull request introduces 1 alert when merging e7601d8 into d0be634 - view on LGTM.com new alerts:
|
Also please update PR description, as it references |
Just curious why a separate script is necessary for this. Why can we not simply add this logic to chassisd when it starts up? |
We decided on a separate script because chassisd is primarily for handling modular chassis management (and thus is only run on modular chassis platforms), a separate task from uploading basic information such as serial, model, and hardware revision that is applicable to all platforms and also one-shot. |
Since this script is a one-shot script, and not a daemon per se, I have reservations about adding it in this repo. We could simply add it in the buildimage repo as part of sonic-net/sonic-buildimage#7596. However, it would not be built into a package, so we would not be able to run unit tests against it. I'm on the fence, but I guess I can live with having it as part of the chassisd package. |
I would argue that while the name If there exists now or in the future a collection of one-shot tasks for the purpose of provisioning redis then I would argue this should be refactored at that point. |
I agree with this, which is why I am on the fence.
Agreed. We can proceed with this PR. |
…asks (#7596) I added `chassis_db_init` to the startup tasks for the `docker-platform-monitor` docker so that the script is run on startup of the switch and the chassis info is correctly provisioned to STATE_DB. Depends on sonic-net/sonic-platform-daemons#183
… and version (#1624) #### What I did I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version` #### How I did it I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script. The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
… and version (sonic-net#1624) #### What I did I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version` #### How I did it I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script. The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
…et#183) #### Description I added a new script `chassis_db_init` that uploads chassis hardware information such as serial number, model number and hardware revision to the STATE_DB under the CHASSIS_INFO table. #### Motivation and Context I made this change in order to expose the chassis hardware information to SONiC user space and allow CLI utilities to access it in order to expose it to the user.
…asks (sonic-net#7596) I added `chassis_db_init` to the startup tasks for the `docker-platform-monitor` docker so that the script is run on startup of the switch and the chassis info is correctly provisioned to STATE_DB. Depends on sonic-net/sonic-platform-daemons#183
… and version (sonic-net#1624) #### What I did I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version` #### How I did it I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script. The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
… and version (sonic-net#1624) I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version` I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script. The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
#### Description I added a new script `chassis_db_init` that uploads chassis hardware information such as serial number, model number and hardware revision to the STATE_DB under the CHASSIS_INFO table. #### Motivation and Context I made this change in order to expose the chassis hardware information to SONiC user space and allow CLI utilities to access it in order to expose it to the user.
Update sonic-platform-daemons submodule pointer to include the following: * [chassisd] Add script to initialize chassis info in STATE_DB ([sonic-net#183](sonic-net/sonic-platform-daemons#183)) Signed-off-by: dprital <drorp@nvidia.com>
Update sonic-platform-daemons submodule pointer to include the following: * [chassisd] Add script to initialize chassis info in STATE_DB ([#183](sonic-net/sonic-platform-daemons#183)) Signed-off-by: dprital <drorp@nvidia.com>
… and version (#1624) #### What I did I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version` #### How I did it I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script. The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
Description
I added a new script
chassis_db_init
that uploads chassis hardware information such as serial number, model number and hardware revision to the STATE_DB under the CHASSIS_INFO table.Motivation and Context
I made this change in order to expose the chassis hardware information to SONiC user space and allow CLI utilities to access it in order to expose it to the user.
How Has This Been Tested?
Unit tests were added and was deployed and tested on Mellanox platform MSN2700.