Skip to content

Commit 267f9da

Browse files
committed
Improve error handling during switch reinstall
Signed-off-by: Pau Capdevila <pau@githedgehog.com>
1 parent 0b9ea04 commit 267f9da

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/hhfab/vlabhelpers_reinstall.exp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ if { ! $POWER_RESET} {
169169

170170
expect -timeout 150 -ex "GNU GRUB" {
171171
log_message "INF" $SW_NAME "GRUB Menu detected"
172-
# Select the ONIE option, and finally the Install OS option
173172
sleep 1
174173
send -- "$KEY_HOME"
175174
set timeout 1
@@ -185,6 +184,10 @@ expect -timeout 150 -ex "GNU GRUB" {
185184
"ONIE: OS Install Mode ..." {
186185
log_message "INF" $SW_NAME "Entering OS Install Mode..."
187186
}
187+
eof {
188+
log_message "ERR" $SW_NAME "Connection lost before confirming ONIE install mode"
189+
exit $ERROR_CONSOLE
190+
}
188191
timeout {
189192
send "\r"
190193
}
@@ -194,6 +197,10 @@ expect -timeout 150 -ex "GNU GRUB" {
194197
send -- "$KEY_DOWN"
195198
exp_continue
196199
}
200+
eof {
201+
log_message "ERR" $SW_NAME "Connection lost during GRUB menu expect"
202+
exit $ERROR_CONSOLE
203+
}
197204
}
198205
} timeout {
199206
log_message "ERR" $SW_NAME "Failed to reset. GRUB not detected."

0 commit comments

Comments
 (0)