X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fcapture-instance-metadata.sh;h=a5914ad98bc6fe22bb3aa4f5204191e51c994a6a;hb=ae9f2f497f6a9c036fc9ffaf4f95d72a0cab6f2e;hp=23a9f2bf74c42e14a7f7a01b4be8acf4e67cf671;hpb=50b6737cb8b73ea2311b2992e7dfd6611f60b07c;p=releng%2Fglobal-jjb.git diff --git a/shell/capture-instance-metadata.sh b/shell/capture-instance-metadata.sh index 23a9f2bf..a5914ad9 100644 --- a/shell/capture-instance-metadata.sh +++ b/shell/capture-instance-metadata.sh @@ -17,10 +17,11 @@ if [ -n "${NOMAD_DC}" ]; then exit 0 fi -# detect if we're in AWS -if grep -qi amazon /sys/devices/virtual/dmi/id/bios_vendor ; then - echo "INFO: Running in AWS, not capturing instance metadata" - exit 0 +# AWS not supported, exit +cloudtype="$(jq -r .v1.datasource /run/cloud-init/result.json)" +if [[ $cloudtype == "DataSourceEc2Local" ]]; then + echo "INFO: Running in AWS, not capturing instance metadata" + exit 0 fi # Retrive OpenStack instace metadata APIs at this IP.