From cfe6494e335f277155582ba564bdceae1ee043fd Mon Sep 17 00:00:00 2001 From: Aric Gardner Date: Mon, 17 Aug 2020 16:03:58 -0400 Subject: [PATCH] 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 --- shell/job-cost.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.16.6