From 46f4ba345420a438774fe5914f2652929462e926 Mon Sep 17 00:00:00 2001 From: Giacomo Marciani Date: Tue, 15 Oct 2024 17:03:31 +0200 Subject: [PATCH] [CodeStyle] Address Shellcheck finding 'SC2155 in iso-ca-bundle-config.sh': _token variable is now declared and assigned separately to avoid masking return values. Signed-off-by: Giacomo Marciani --- .../files/isolated/iso-ca-bundle-config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbooks/aws-parallelcluster-platform/files/isolated/iso-ca-bundle-config.sh b/cookbooks/aws-parallelcluster-platform/files/isolated/iso-ca-bundle-config.sh index 991daa72f..c72732b7b 100644 --- a/cookbooks/aws-parallelcluster-platform/files/isolated/iso-ca-bundle-config.sh +++ b/cookbooks/aws-parallelcluster-platform/files/isolated/iso-ca-bundle-config.sh @@ -2,7 +2,8 @@ set -ex function get_instance_region { - local _token=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 3600") + local _token + _token=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 3600") curl -H "X-aws-ec2-metadata-token: $_token" -v "http://169.254.169.254/latest/meta-data/placement/region" 2> /dev/null }