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 <agardner@linuxfoundation.org>
Change-Id: I57e27fe5bb2135e738b33c0f6de78f1759bcb93d
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