From ecaac399901fb223179eb76a0f349901b3aedc43 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Tue, 29 Mar 2022 13:26:01 +0200 Subject: [PATCH] configure abort on http error --- director-cli.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/director-cli.sh b/director-cli.sh index 5c7af16..696e033 100755 --- a/director-cli.sh +++ b/director-cli.sh @@ -250,6 +250,8 @@ typeset cfg_dryrun=false local _bShowResponse=true local _bShowFilter=false + local _bStopOnError=true + # local _sCachefile= _initHttp @@ -321,6 +323,7 @@ typeset cfg_dryrun=false _sMethod=GET _sUrl=$_sUrlExists _bShowResponse=false + _bStopOnError=false ;; 'create') _sMethod=PUT @@ -366,7 +369,7 @@ typeset cfg_dryrun=false if [ ${_paramDryrun} = false ]; then _wd ">>>>> $_paramAction $_paramObj [${_object_name}] >> $_sMethod $_sUrl $_jsondata" http.makeRequest "$_sMethod" "$_sUrl" "$_jsondata" - if http.isServerError >/dev/null; then + if _bStopOnError && http.isServerError >/dev/null; then echo "CRITICAL ERROR: Director API request failed with a server error $_sMethod $_sUrl" exit 1 fi -- GitLab