Updates the 'capture-instance-metadata.sh' script to skip attempting to
capture instance metadata needed for job-cost.sh if the build is being
run on an unsupported cloud or platform.
Change-Id: I8bfea1416d11de1caeed2d414b90513f63de9b6f
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
--- /dev/null
+---
+fixes:
+ - |
+ Updates the 'capture-instance-metadata.sh' script to skip attempting
+ to capture instance metadata needed for job-cost.sh if the build is
+ being run on an unsupported cloud or platform.
exit 0
fi
+if [[ ! -f /run/cloud-init/result.json ]]; then
+ echo "INFO: Running in unsupported cloud, no metadata"
+ exit 0
+fi
+
# AWS not supported, exit
cloudtype="$(jq -r .v1.datasource /run/cloud-init/result.json)"
if [[ $cloudtype == "DataSourceEc2Local" ]]; then