[smartswitch] Update get_gnmi_port() based on smartswitch config updates#4041
[smartswitch] Update get_gnmi_port() based on smartswitch config updates#4041judyjoseph merged 2 commits intosonic-net:masterfrom
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull Request Overview
This PR updates the get_gnmi_port() function in the smartswitch reboot helper script to align with recent YANG model changes for DPU configuration. The function now retrieves the GNMI port from the updated CONFIG_DB schema.
Key changes:
- Modified database key pattern from
DPU_PORT|$DPU_NAMEtoDPU|*$DPU_NAME - Added default parameter value for DPU_NAME
- Updated query method to iterate through matching keys
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
hi @vvolam This change looks fine but I had another question. In function gnmi_reboot_dpu, DPU_NAME is not explicitly declared inside it, so how is it having the right value? I would assume a local DPU_NAME which then gets the value from $1, is it not? |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Good catch! Added a local variable for robustness, though it is working as expected. |
| @@ -138,6 +140,8 @@ function wait_for_dpu_reboot_status() | |||
| # Function to send reboot command to DPU | |||
| function gnmi_reboot_dpu() | |||
|
Cherry-pick PR to 202505: #4043 |
…tes (sonic-net#4041) * Update get_gnmi_port() based on config updates * Add a local define of DPU_NAME in gnmi_reboot_dpu()
What I did
This PR updates the get_gnmi_port() function in the smartswitch reboot helper script to align with recent YANG model changes for DPU configuration. The function now retrieves the GNMI port from the updated CONFIG_DB schema.
https://github.com/sonic-net/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md#dpu-configuration
How I did it
How to verify it
Run the reboot command with latest configuration changes.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)