From: Thanh Ha Date: Mon, 12 Jun 2017 00:37:00 +0000 (-0400) Subject: Improve error detection for when SSL invalid X-Git-Tag: v0.3.1~1 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=032dbba;p=releng%2Flftools.git Improve error detection for when SSL invalid If SSL cert is invalid we don't even reach the Nexus server. So add code to check that status is 201 before proceeding. Change-Id: Ic5c8a0ce4177f73e6f753001ee8bbc5fdf02956c Signed-off-by: Thanh Ha --- diff --git a/shell/deploy b/shell/deploy index 20dc09bc..ac987e0c 100755 --- a/shell/deploy +++ b/shell/deploy @@ -317,7 +317,7 @@ EOF local resp local status - resp=$(curl -s -w "%{http_code}" --netrc -X POST -d "@$FILE_XML" \ + resp=$(curl -s -w " %{http_code}" --netrc -X POST -d "@$FILE_XML" \ -H "Content-Type:application/xml" \ "${nexus_url}/service/local/staging/profiles/${staging_profile_id}/start") status=$(echo "$resp" | awk 'END {print $NF}') @@ -327,6 +327,9 @@ EOF msg=$(sed -n -e 's/.*\(.*\)<\/msg>.*/\1/p' <<< $resp) echo "ERROR: $msg" exit "$status" + elif [ "$status" != "201" ]; then + echo "ERROR: Failed with status code $status" + exit "$status" fi local staging_repo_id