Skip to content

Commit

Permalink
[reboot]: Allow reboot to happen regardless vendor hook errors (#3454)
Browse files Browse the repository at this point in the history
* [reboot]: Allow reboot to happen regardless vendor hook errors.

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

* [reboot]: Handle review comments.

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

---------

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
  • Loading branch information
nazariig authored and mssonicbld committed Sep 3, 2024
1 parent 8e38545 commit 1481250
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ REBOOT_SCRIPT_NAME=$(basename $0)
REBOOT_TYPE="${REBOOT_SCRIPT_NAME}"
TAG_LATEST=no
REBOOT_FLAGS=""
FORCE_REBOOT="no"

function debug()
{
Expand Down Expand Up @@ -192,7 +191,6 @@ function parse_options()
;;
f )
REBOOT_FLAGS+=" -f"
FORCE_REBOOT="yes"
;;
esac
done
Expand Down Expand Up @@ -278,12 +276,9 @@ fi
if [ -x ${DEVPATH}/${PLATFORM}/${PRE_REBOOT_HOOK} ]; then
debug "Executing the pre-reboot script"
${DEVPATH}/${PLATFORM}/${PRE_REBOOT_HOOK}
EXIT_CODE=$?
if [[ ${EXIT_CODE} != ${EXIT_SUCCESS} ]]; then
if [[ "${FORCE_REBOOT}" != "yes" ]]; then
echo "Reboot is interrupted: use -f (force) to override"
exit ${EXIT_ERROR}
fi
EXIT_CODE="$?"
if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then
debug "WARNING: Failed to handle pre-reboot script: rc=${EXIT_CODE}"
fi
fi

Expand Down

0 comments on commit 1481250

Please sign in to comment.