File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ declare -r GNMI_PORT=8080 # Default GNMI port
44declare -r MODULE_REBOOT_DPU=" DPU"
55declare -r MODULE_REBOOT_SMARTSWITCH=" SMARTSWITCH"
66
7+ declare -r EXIT_DPU_DOWN=2
8+
79# Function to print debug message
810function log_message() {
911 local message=$1
@@ -170,14 +172,13 @@ function reboot_dpu()
170172 oper_status=$( show chassis modules status " ${DPU_NAME^^} " | sed -n ' /^ *DPU/ s/.*\s\+\(Online\|Offline\)\s\+.*/\1/p' )
171173 if [ $? -ne 0 ]; then
172174 log_message " ERROR: Failed to retrieve DPU status."
173- return ${EXIT_ERROR}
174- fi
175-
176- log_message " INFO: DPU ${DPU_NAME} is in '$oper_status ' state before reboot."
177- oper_status=$( echo " $oper_status " | tr ' [:upper:]' ' [:lower:]' )
178- if [ " $oper_status " != " online" ]; then
179- log_message " INFO: ${DPU_NAME} is not online. Current status: $oper_status "
180- return ${EXIT_ERROR}
175+ else
176+ log_message " INFO: DPU ${DPU_NAME} is in '$oper_status ' state before reboot."
177+ oper_status=$( echo " $oper_status " | tr ' [:upper:]' ' [:lower:]' )
178+ if [ " $oper_status " != " online" ]; then
179+ log_message " INFO: ${DPU_NAME} is not online. Current status: $oper_status "
180+ return ${EXIT_DPU_DOWN}
181+ fi
181182 fi
182183
183184 # Send reboot command to DPU
You can’t perform that action at this time.
0 commit comments