From 1c3f706383fcd2784ba0a3e8fb8c209898de2ed9 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Fri, 1 Apr 2016 22:05:14 -0400 Subject: [PATCH] AWS: Don't error if there are no ephemeral disks format-disks used to run with non-strict bash semantics, but this changed in 1.2 as we now merge it into the GCE script, so pipefail and errexit are both set. However, the way we list the ephemeral disks, by piping to grep, would cause an exit code of 2 if there were no ephemeral disks. Tolerate failure here by add `|| true`. The metadata service call is unlikely to fail, so we continue to ignore that possibility. --- cluster/aws/templates/format-disks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/aws/templates/format-disks.sh b/cluster/aws/templates/format-disks.sh index adf3396778..be0ddc2151 100644 --- a/cluster/aws/templates/format-disks.sh +++ b/cluster/aws/templates/format-disks.sh @@ -26,7 +26,7 @@ fi block_devices=() -ephemeral_devices=$(curl --silent http://169.254.169.254/2014-11-05/meta-data/block-device-mapping/ | grep ephemeral) +ephemeral_devices=$( (curl --silent http://169.254.169.254/2014-11-05/meta-data/block-device-mapping/ | grep ephemeral) || true ) for ephemeral_device in $ephemeral_devices; do echo "Checking ephemeral device: ${ephemeral_device}" aws_device=$(curl --silent http://169.254.169.254/2014-11-05/meta-data/block-device-mapping/${ephemeral_device})