diff --git a/director-cli.sh b/director-cli.sh index 5c7af1605ea09fb1b4e64c93b944edfebbbe353c..696e033216c2f25f014f5bd44367ebaeba04ee3e 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