From 2a8be547a805f761bffa97476d74b998b9228634 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Wed, 24 May 2023 16:46:21 +0200 Subject: [PATCH] Added FATAL_FAILURE to log_helpers. Do not send to APIS in case of FATAL_FAILURE. --- log_helpers | 2 ++ update_psa_impl | 12 +++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/log_helpers b/log_helpers index 91b855c..f166ceb 100755 --- a/log_helpers +++ b/log_helpers @@ -18,6 +18,7 @@ if [ "${log_helpers_sourced:-1}" = "1" ]; then # include only once readonly MAX_DEBUG_LEVEL=6 log_level=$INFO + FATAL_FAILURE=false set_dbg_level () { if [ $1 < $MAX_DEBUG_LEVEL ]; then @@ -83,6 +84,7 @@ if [ "${log_helpers_sourced:-1}" = "1" ]; then # include only once if [ $log_level -le $FATAL ]; then log "FATAL $*" log "exiting ..." + FATAL_FAILURE=true exit 1 fi } diff --git a/update_psa_impl b/update_psa_impl index 98ac476..bb61b8f 100755 --- a/update_psa_impl +++ b/update_psa_impl @@ -13,6 +13,8 @@ trap collect_current_configuration EXIT collect_current_configuration () { local func="${FUNCNAME[0]}" + $FATAL_FAILURE && return 1 + # TODO: eventuell muss die version neu berechnet werden current_settings_to_ismas @@ -28,15 +30,7 @@ collect_current_configuration () { #done } -update_psa() { # calling with a parameter is used for testing - - if [ $# -eq 0 ]; then - if ! updates_available; then # check for false alarm - update_psa_false_alarm "update requested, but no WAIT state detected" - exit $EXITCODE - fi - fi - +update_psa() { update_psa_activated # message to ISMAS local func="${FUNCNAME[0]}"