From: Eric Ball Date: Thu, 12 Mar 2020 15:08:40 +0000 (+0000) Subject: Merge "Refactor lf-c-cpp-jobs for common anchor" X-Git-Tag: v0.52.0~3 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=5fca6a99161351464865647c4bb44057a67debe1;hp=d7dac61f2959c925e82af20b2491cc091e06e095;p=releng%2Fglobal-jjb.git Merge "Refactor lf-c-cpp-jobs for common anchor" --- diff --git a/releasenotes/notes/fix_costing_jq_test-0d6954b3384ea99d.yaml b/releasenotes/notes/fix_costing_jq_test-0d6954b3384ea99d.yaml new file mode 100644 index 00000000..133b08be --- /dev/null +++ b/releasenotes/notes/fix_costing_jq_test-0d6954b3384ea99d.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Update jq validation of returned json blocks to work properly with jq v1.5. diff --git a/shell/job-cost.sh b/shell/job-cost.sh index a7dceea4..cb5f1a59 100644 --- a/shell/job-cost.sh +++ b/shell/job-cost.sh @@ -59,7 +59,7 @@ url="https://pricing.vexxhost.net/v1/pricing/$instance_type/cost?seconds=$uptime json_block=$(curl -s "$url") # check if JSON returned and can be parsed -if jq <<< "$json_block" > /dev/null 2>&1; then +if jq . <<< "$json_block" > /dev/null 2>&1; then cost=$(jq .cost <<< "$json_block") resource=$(jq .resource <<< "$json_block" | tr -d '"') else