Skip to content
Snippets Groups Projects
Commit ecaac399 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

configure abort on http error

parent 3111958e
No related branches found
No related tags found
1 merge request!11configure abort on http error
...@@ -250,6 +250,8 @@ typeset cfg_dryrun=false ...@@ -250,6 +250,8 @@ typeset cfg_dryrun=false
local _bShowResponse=true local _bShowResponse=true
local _bShowFilter=false local _bShowFilter=false
local _bStopOnError=true
# local _sCachefile= # local _sCachefile=
_initHttp _initHttp
...@@ -321,6 +323,7 @@ typeset cfg_dryrun=false ...@@ -321,6 +323,7 @@ typeset cfg_dryrun=false
_sMethod=GET _sMethod=GET
_sUrl=$_sUrlExists _sUrl=$_sUrlExists
_bShowResponse=false _bShowResponse=false
_bStopOnError=false
;; ;;
'create') 'create')
_sMethod=PUT _sMethod=PUT
...@@ -366,7 +369,7 @@ typeset cfg_dryrun=false ...@@ -366,7 +369,7 @@ typeset cfg_dryrun=false
if [ ${_paramDryrun} = false ]; then if [ ${_paramDryrun} = false ]; then
_wd ">>>>> $_paramAction $_paramObj [${_object_name}] >> $_sMethod $_sUrl $_jsondata" _wd ">>>>> $_paramAction $_paramObj [${_object_name}] >> $_sMethod $_sUrl $_jsondata"
http.makeRequest "$_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" echo "CRITICAL ERROR: Director API request failed with a server error $_sMethod $_sUrl"
exit 1 exit 1
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment