TT#43251 Move wait for ngcpstatus seconds to separate function

If 'systemctl reboot|halt' is called within script 'trap' function
is not called so deployment.sh does not wait and jenkins can miss
the status.
Move waiting to separate function and call it directly so there is
waiting in the end of deployment.sh in any case.

Change-Id: Ib93bf6fd4e6f133c9342d02d412ea1f18cdceba6
changes/30/23130/1
Mykola Malkov 7 years ago
parent af30d88027
commit e431387e57

@ -306,9 +306,7 @@ ensure_packages_installed() {
done
}
wait_exit() {
local e_code="${?}"
trap '' 1 2 3 6 15 ERR EXIT
status_wait() {
if [[ -n "${STATUS_WAIT}" ]] && [[ "${STATUS_WAIT}" != 0 ]]; then
# if ngcpstatus boot option is used wait for a specific so a
# remote host has a chance to check for deploy status "finished",
@ -316,7 +314,12 @@ wait_exit() {
echo "Sleeping for ${STATUS_WAIT} seconds (as requested via boot option 'ngcpstatus')"
sleep "${STATUS_WAIT}"
fi
}
wait_exit() {
local e_code="${?}"
trap '' 1 2 3 6 15 ERR EXIT
status_wait
exit "${e_code}"
}
@ -1983,6 +1986,8 @@ if "$INTERACTIVE" ; then
exit 0
fi
status_wait
# do not prompt when running in automated mode
if "$REBOOT" ; then
echo "Rebooting system as requested via ngcpreboot"

Loading…
Cancel
Save