Merge "Fix job cost amazon exception"
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Thu, 20 Aug 2020 19:57:49 +0000 (19:57 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Thu, 20 Aug 2020 19:57:49 +0000 (19:57 +0000)
shell/job-cost.sh

index cb5f1a5..595b342 100644 (file)
@@ -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