From: Aric Gardner Date: Mon, 17 Aug 2020 20:03:58 +0000 (-0400) Subject: Fix job cost amazon exception X-Git-Tag: v0.57.0~3^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=cfe6494e335f277155582ba564bdceae1ee043fd;p=releng%2Fglobal-jjb.git Fix job cost amazon exception bios_vendor file now says Xen, no amazon string to match on any longer. cat /sys/devices/virtual/dmi/id/bios_vendor Xen however result.json has the info we need. /run/cloud-init/result.json { "v1": { "datasource": "DataSourceEc2Local", "errors": [] } } Issue-Id: RELENG-3163 Signed-off-by: Aric Gardner Change-Id: I57e27fe5bb2135e738b33c0f6de78f1759bcb93d --- diff --git a/shell/job-cost.sh b/shell/job-cost.sh index cb5f1a59..595b342e 100644 --- a/shell/job-cost.sh +++ b/shell/job-cost.sh @@ -16,7 +16,8 @@ set -euf -o pipefail source ~/lf-env.sh # AWS job cost not supported, exit -if grep -qi amazon /sys/devices/virtual/dmi/id/bios_vendor ; then +cloudtype="$(jq -r .v1.datasource /run/cloud-init/result.json)" +if [[ $cloudtype == "DataSourceEc2Local" ]]; then echo "INFO: Not able to calculate job cost on AWS" exit 0 fi